You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(191) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(238) |
Dec
(68) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(104) |
Feb
(518) |
Mar
(302) |
Apr
(211) |
May
(311) |
Jun
(55) |
Jul
(6) |
Aug
(35) |
Sep
(76) |
Oct
(50) |
Nov
(37) |
Dec
(340) |
2007 |
Jan
(23) |
Feb
(107) |
Mar
(98) |
Apr
(60) |
May
(136) |
Jun
(371) |
Jul
(175) |
Aug
(74) |
Sep
(3) |
Oct
(2) |
Nov
(53) |
Dec
(129) |
2008 |
Jan
(337) |
Feb
(23) |
Mar
(18) |
Apr
(4) |
May
(3) |
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(33) |
Nov
|
Dec
(26) |
2009 |
Jan
(4) |
Feb
(1) |
Mar
(15) |
Apr
|
May
(35) |
Jun
(11) |
Jul
|
Aug
|
Sep
(19) |
Oct
(26) |
Nov
(11) |
Dec
(11) |
2010 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
(8) |
Dec
(7) |
2011 |
Jan
|
Feb
|
Mar
(4) |
Apr
(8) |
May
(5) |
Jun
(8) |
Jul
(1) |
Aug
|
Sep
|
Oct
(5) |
Nov
(13) |
Dec
|
From: John L. <jr...@us...> - 2007-12-10 05:39:39
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23281/wxLua/docs Modified Files: changelog.txt 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: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** changelog.txt 7 Dec 2007 02:13:10 -0000 1.50 --- changelog.txt 10 Dec 2007 05:39:05 -0000 1.51 *************** *** 25,29 **** registry that we use and those methods were not useful anymore. The lightuserdata keys are now const char* strings with a descriptive name, ! however only the mem address is used as the table key. - wxluaT_newtag() now leaves the created table on the stack. - Removed wxluaT_newweaktag() and wxluaT_settagmethod() since they were --- 25,29 ---- registry that we use and those methods were not useful anymore. The lightuserdata keys are now const char* strings with a descriptive name, ! however it is the mem address that is used as the table key. - wxluaT_newtag() now leaves the created table on the stack. - Removed wxluaT_newweaktag() and wxluaT_settagmethod() since they were *************** *** 38,41 **** --- 38,50 ---- The result is that wxLua should be faster. + - Applied patches to Lua 5.1.2 #8-11 + lua_setfenv may crash if called over an invalid object. + - Made the garbage collector more aggressive since we push void* pointers + but the data behind them may be quite large. Unfortunately there is no + mechanism to give a size hint to Lua without modifying Lua. + lua_gc(L, LUA_GCSETPAUSE, 120); lua_gc(L, LUA_GCSETSTEPMUL, 400); + - Added wxLuaArtProvider with virtual functions to create custom + wxArtProviders in Lua. + version 2.8.4.2 -------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2007-12-10 05:39:22
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23281/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlcallb.cpp wxlstate.cpp wxlua.cpp wxlua_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: wxlua.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxlua.cpp 7 Dec 2007 06:44:47 -0000 1.6 --- wxlua.cpp 10 Dec 2007 05:39:10 -0000 1.7 *************** *** 72,80 **** static int LUACALL wxLua_wxLuaObject_GetAllocationFlag(lua_State *L) { - int returns; // get this wxLuaObject * self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); // call GetAllocationFlag ! returns = (self->GetAllocationFlag()); // push the result number lua_pushnumber(L, returns); --- 72,79 ---- static int LUACALL wxLua_wxLuaObject_GetAllocationFlag(lua_State *L) { // get this wxLuaObject * self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); // call GetAllocationFlag ! int returns = (self->GetAllocationFlag()); // push the result number lua_pushnumber(L, returns); Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.148 retrieving revision 1.149 diff -C2 -d -r1.148 -r1.149 *** wxlstate.cpp 8 Dec 2007 00:25:24 -0000 1.148 --- wxlstate.cpp 10 Dec 2007 05:39:10 -0000 1.149 *************** *** 25,30 **** const char* wxlua_lreg_tags_key = "wxLua metatable class tags"; const char* wxlua_lreg_refs_key = "wxLua object references"; ! const char* wxlua_lreg_debug_refs_key = "wxLuaDebug references"; ! const char* wxlua_lreg_classes_key = "wxLuaBindClasses structs"; const char* wxlua_lreg_derivedmethods_key = "wxLua derived class methods"; const char* wxlua_lreg_wxluastate_key = "wxLuaState"; --- 25,30 ---- const char* wxlua_lreg_tags_key = "wxLua metatable class tags"; const char* wxlua_lreg_refs_key = "wxLua object references"; ! const char* wxlua_lreg_debug_refs_key = "wxLuaDebugData references"; ! const char* wxlua_lreg_classes_key = "wxLuaBindClass structs"; const char* wxlua_lreg_derivedmethods_key = "wxLua derived class methods"; const char* wxlua_lreg_wxluastate_key = "wxLuaState"; *************** *** 37,40 **** --- 37,41 ---- const char* wxlua_lreg_wxeventtype_key = "wxLua wxEventType"; const char* wxlua_lreg_wxluadebughookdata_key = "wxLuaDebugHookData"; + const char* wxlua_lreg_regtable_key = "wxLua LUA_REGISTRYINDEX tables"; const char* wxlua_metatable_tag_key = "wxLua Metatable Class Tag"; *************** *** 61,65 **** // figure out the types here in c++ land lua_getglobal(L, "tostring"); ! for (i = 1; i <= n; i++) { if (i > 1) msg.Append(wxT("\t")); // Lua uses a tab too in luaB_print --- 62,66 ---- // figure out the types here in c++ land lua_getglobal(L, "tostring"); ! for (i = 1; i <= n; ++i) { if (i > 1) msg.Append(wxT("\t")); // Lua uses a tab too in luaB_print *************** *** 119,123 **** // Assume they've set the wxEvtHandler, ok if not, but it wouldn't make sense // We use wxLuaState::SendEvent() because it sets wxEvent::SetEventObject() for us. ! if (hookData->m_lua_debug_hook_send_evt) { wxLuaState wxlState(L); --- 120,124 ---- // Assume they've set the wxEvtHandler, ok if not, but it wouldn't make sense // We use wxLuaState::SendEvent() because it sets wxEvent::SetEventObject() for us. ! if (hookData->m_lua_debug_hook_send_evt) { wxLuaState wxlState(L); *************** *** 169,172 **** --- 170,204 ---- // ---------------------------------------------------------------------------- + + void wxlua_lreg_createtable(lua_State* L, void* lightuserdata_reg_key) + { + // clear the old ref to the table, even though it's weak kv + // it doesn't get cleared until the gc runs + lua_pushlightuserdata(L, &wxlua_lreg_regtable_key); // push key + lua_rawget(L, LUA_REGISTRYINDEX); // get table + lua_pushlightuserdata(L, lightuserdata_reg_key); // push key + lua_rawget(L, LUA_REGISTRYINDEX); // get table or nil + if (lua_istable(L, -1)) + { + lua_pushnil(L); // push value + lua_rawset(L, -3); // clear t[key] = nil + lua_pop(L, 1); + } + else + lua_pop(L, 2); + + // Add new LUA_REGISTRYINDEX[lightuserdata_reg_key table] = lightuserdata_reg_key + lua_pushlightuserdata(L, lightuserdata_reg_key); // push key + lua_newtable(L); // push value + lua_pushlightuserdata(L, &wxlua_lreg_regtable_key); // push key + lua_rawget(L, LUA_REGISTRYINDEX); // get wxlua_lreg_regtable_key table + lua_pushvalue(L, -2); // push key (copy of the new table) + lua_pushvalue(L, -4); // push value (copy of lightuserdata key) + lua_rawset(L, -3); // set t[key] = value; pops key and value + lua_pop(L, 1); // pop wxlua_lreg_regtable_key table + lua_rawset(L, LUA_REGISTRYINDEX); // set the value + } + + // ---------------------------------------------------------------------------- // Lua helper functions // ---------------------------------------------------------------------------- *************** *** 678,681 **** --- 710,741 ---- } + wxArrayString LUACALL wxluaO_gettrackedobjectstrings(lua_State *L) + { + wxArrayString arrStr; + + lua_pushlightuserdata(L, &wxlua_lreg_delobjects_key); // push key + lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) + + lua_pushnil(L); + while (lua_next(L, -2) != 0) + { + // value = -1, key = -2, table = -3 + wxString name(wxT("wxObject?")); + + wxObject* obj = (wxObject*)lua_touserdata(L, -1); + if (obj && obj->GetClassInfo() && obj->GetClassInfo()->GetClassName()) + name = obj->GetClassInfo()->GetClassName(); + + arrStr.Add(wxString::Format(wxT("%s %p"), name.c_str(), obj)); + + lua_pop(L, 1); // pop value, lua_next will pop key at end + } + + lua_pop(L, 1); // pop table + + arrStr.Sort(); + return arrStr; + } + void LUACALL wxluaO_cleartrackedmetatable(lua_State *L, const void *u) { *************** *** 764,767 **** --- 824,853 ---- } + wxArrayString LUACALL wxluaW_gettrackedwindowstrings(lua_State *L) + { + wxArrayString arrStr; + + lua_pushlightuserdata(L, &wxlua_lreg_topwindows_key); // push key + lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) + + lua_pushnil(L); + while (lua_next(L, -2) != 0) + { + // value = -1, key = -2, table = -3 + wxWindow* win = (wxWindow*)lua_touserdata(L, -2); + wxCHECK_MSG(win, arrStr, wxT("Invalid wxWindow")); + + wxString name(win->GetClassInfo()->GetClassName()); + arrStr.Add(wxString::Format(wxT("%s(%p id=%d)"), name.c_str(), win, win->GetId())); + + lua_pop(L, 1); // pop value, lua_next will pop key at end + } + + lua_pop(L, 1); // pop table + + arrStr.Sort(); + return arrStr; + } + // ---------------------------------------------------------------------------- // Functions to get info about the tags wxlua uses to determine type *************** *** 783,787 **** wxlClass = wxlClass->baseclass; ! levels++; } --- 869,873 ---- wxlClass = wxlClass->baseclass; ! ++levels; } *************** *** 799,807 **** while (c != NULL) { ! if (c->class_tag == wxlBaseClass->class_tag) return levels; c = c->baseclass; ! levels++; } --- 885,893 ---- while (c != NULL) { ! if (c->class_tag == wxlBaseClass->class_tag) // comparing pointers return levels; c = c->baseclass; ! ++levels; } *************** *** 862,879 **** // if we don't know the type (it's not predefined) ! if ((ret < 0) && L) { ! if (luatype == LUA_TTABLE) ! { ! const wxLuaBindClass* wxlClass = wxluaT_getclass(L, wxluaarg_tag); ! ! const wxLuaBindClass* arrClass = wxluaT_getclass(L, "wxArrayString"); ! if (wxlClass && (wxlua_isderivedclass(wxlClass, arrClass) >= 0)) ! return 1; ! arrClass = wxluaT_getclass(L, "wxArrayInt"); ! if (wxlClass && (wxlua_isderivedclass(wxlClass, arrClass) >= 0)) ! return 1; ! } } --- 948,961 ---- // if we don't know the type (it's not predefined) ! if ((ret < 0) && L &&(luatype == LUA_TTABLE)) { ! const wxLuaBindClass* wxlClass = wxluaT_getclass(L, wxluaarg_tag); ! if (wxlua_isderivedclass(wxlClass, wxluaT_getclass(L, "wxArrayString")) >= 0) ! ret = 1; ! else if (wxlua_isderivedclass(wxlClass, wxluaT_getclass(L, "wxSortedArrayString")) >= 0) ! ret = 1; ! else if (wxlua_isderivedclass(wxlClass, wxluaT_getclass(L, "wxArrayInt")) >= 0) ! ret = 1; } *************** *** 1083,1104 **** const char** LUACALL wxlua_getchararray(lua_State *L, int stack_idx, int &count) { ! const char **pItems = NULL; count = 0; if (lua_istable(L, stack_idx)) { ! int nItems = lua_objlen(L, stack_idx); ! if (nItems > 0) ! pItems = new const char *[nItems]; ! if (pItems != NULL) { ! for (int idx = 1; idx <= nItems; ++idx) { ! lua_rawgeti(L, stack_idx, idx); ! const char *pValue = wxlua_getstringtype(L, -1); ! pItems[count++] = pValue; lua_pop(L, 1); } } } else --- 1165,1189 ---- const char** LUACALL wxlua_getchararray(lua_State *L, int stack_idx, int &count) { ! const char **arrChar = NULL; count = 0; if (lua_istable(L, stack_idx)) { ! int table_len = lua_objlen(L, stack_idx); ! if (table_len > 0) ! arrChar = new const char *[table_len]; ! ! if (arrChar != NULL) { ! for (int n = 0; n < table_len; ++n) { ! lua_rawgeti(L, stack_idx, n+1); // Lua array starts at 1 ! const char *s = wxlua_getstringtype(L, -1); ! arrChar[n] = s; // share Lua string lua_pop(L, 1); } } + + count = table_len; } else *************** *** 1109,1113 **** } ! return pItems; } --- 1194,1198 ---- } ! return arrChar; } *************** *** 1134,1138 **** count = (int)((wxArrayInt&)arr).GetCount(); intArray = new int[count]; ! for (int n = 0; n < count; n++) intArray[n] = ((wxArrayInt&)arr)[n]; --- 1219,1223 ---- count = (int)((wxArrayInt&)arr).GetCount(); intArray = new int[count]; ! for (int n = 0; n < count; ++n) intArray[n] = ((wxArrayInt&)arr)[n]; *************** *** 1798,1808 **** // remove refs table to try to clear memory gracefully ! lua_pushlightuserdata(m_lua_State, &wxlua_lreg_refs_key); ! lua_newtable(m_lua_State); ! lua_rawset(m_lua_State, LUA_REGISTRYINDEX); ! ! lua_pushlightuserdata(m_lua_State, &wxlua_lreg_debug_refs_key); ! lua_newtable(m_lua_State); ! lua_rawset(m_lua_State, LUA_REGISTRYINDEX); //lua_pushlightuserdata(m_lua_State, &wxlua_lreg_derivedmethods_key); // gc will delete them --- 1883,1888 ---- // remove refs table to try to clear memory gracefully ! wxlua_lreg_createtable(m_lua_State, &wxlua_lreg_refs_key); ! wxlua_lreg_createtable(m_lua_State, &wxlua_lreg_debug_refs_key); //lua_pushlightuserdata(m_lua_State, &wxlua_lreg_derivedmethods_key); // gc will delete them *************** *** 1855,1861 **** lua_pop(L, 1); // pop table ! lua_pushlightuserdata(L, &wxlua_lreg_evtcallbacks_key); // push key ! lua_newtable(L); // push value ! lua_rawset(L, LUA_REGISTRYINDEX); // set t[key] = value, pops key and value // ---------------------------------------------------------------------- --- 1935,1939 ---- lua_pop(L, 1); // pop table ! wxlua_lreg_createtable(m_lua_State, &wxlua_lreg_evtcallbacks_key); // ---------------------------------------------------------------------- *************** *** 1880,1886 **** lua_pop(L, 1); // pop table ! lua_pushlightuserdata(L, &wxlua_lreg_windestroycallbacks_key); // push key ! lua_newtable(L); // push value ! lua_rawset(L, LUA_REGISTRYINDEX); // set t[key] = value, pops key and value } --- 1958,1962 ---- lua_pop(L, 1); // pop table ! wxlua_lreg_createtable(m_lua_State, &wxlua_lreg_windestroycallbacks_key); } *************** *** 1952,1955 **** --- 2028,2037 ---- M_WXLSTATEDATA->m_lua_State_static = WXLUA_HASBIT(state_type, wxLUASTATE_STATICSTATE); + // Make the GC a little more aggressive since we push void* data + // that may quite large. The upshot is that Lua runs faster. + // Empirically found by timing: "for i = 1, 1E6 do local p = wx.wxPoint() end" + lua_gc(L, LUA_GCSETPAUSE, 120); + lua_gc(L, LUA_GCSETSTEPMUL, 400); + // Create a new state to push into Lua, the last wxLuaStateRefData will delete it. // Note: we call SetRefData() so that we don't increase the ref count. *************** *** 1963,1967 **** lua_rawset( L, LUA_REGISTRYINDEX ); // set the value ! // start off not in an event wxlua_setwxeventtype(L, wxEVT_NULL); --- 2045,2049 ---- lua_rawset( L, LUA_REGISTRYINDEX ); // set the value ! // start off not in an event wxlua_setwxeventtype(L, wxEVT_NULL); *************** *** 1975,2007 **** // shouldn't bother anyone. ! // create the tags table in registry ! lua_pushlightuserdata(L, &wxlua_lreg_tags_key); ! lua_newtable(L); lua_rawset(L, LUA_REGISTRYINDEX); // set the value // create the refs table in registry ! lua_pushlightuserdata(L, &wxlua_lreg_refs_key); ! lua_newtable(L); ! lua_rawset(L, LUA_REGISTRYINDEX); // set the value // create the debug refs table in registry ! lua_pushlightuserdata(L, &wxlua_lreg_debug_refs_key); ! lua_newtable(L); ! lua_rawset(L, LUA_REGISTRYINDEX); // set the value // create the wxLuaBindClasses table in the registry ! lua_pushlightuserdata(L, &wxlua_lreg_classes_key); ! lua_newtable(L); ! lua_rawset(L, LUA_REGISTRYINDEX); // Create a table for overridden methods for C++ userdata objects ! lua_pushlightuserdata(L, &wxlua_lreg_derivedmethods_key); ! lua_newtable(L); ! lua_rawset( L, LUA_REGISTRYINDEX ); // set the value // Create a table for the userdata that we've pushed into Lua // Use weak values so the gc works on them lua_pushlightuserdata(L, &wxlua_lreg_weakobjects_key); ! lua_newtable(L); // main table lua_newtable(L); // metatable lua_pushlstring(L, "__mode", 6); --- 2057,2089 ---- // shouldn't bother anyone. ! lua_pushlightuserdata(L, &wxlua_lreg_regtable_key); ! lua_newtable(L); // main table ! lua_newtable(L); // metatable ! lua_pushlstring(L, "__mode", 6); ! lua_pushlstring(L, "kv", 2); ! lua_rawset(L, -3); // set mode of main table ! lua_setmetatable(L, -2); // via the metatable lua_rawset(L, LUA_REGISTRYINDEX); // set the value + // create the tags table in registry + wxlua_lreg_createtable(L, &wxlua_lreg_tags_key); + // create the refs table in registry ! wxlua_lreg_createtable(L, &wxlua_lreg_refs_key); // create the debug refs table in registry ! wxlua_lreg_createtable(L, &wxlua_lreg_debug_refs_key); // create the wxLuaBindClasses table in the registry ! wxlua_lreg_createtable(L, &wxlua_lreg_classes_key); // Create a table for overridden methods for C++ userdata objects ! wxlua_lreg_createtable(L, &wxlua_lreg_derivedmethods_key); // Create a table for the userdata that we've pushed into Lua // Use weak values so the gc works on them + wxlua_lreg_createtable(L, &wxlua_lreg_weakobjects_key); lua_pushlightuserdata(L, &wxlua_lreg_weakobjects_key); ! lua_rawget(L, LUA_REGISTRYINDEX); lua_newtable(L); // metatable lua_pushlstring(L, "__mode", 6); *************** *** 2009,2033 **** lua_rawset(L, -3); // set mode of main table lua_setmetatable(L, -2); // via the metatable ! lua_rawset( L, LUA_REGISTRYINDEX ); // set the value // Create a table for objects to delete ! lua_pushlightuserdata(L, &wxlua_lreg_delobjects_key); ! lua_newtable(L); ! lua_rawset( L, LUA_REGISTRYINDEX ); // set the value // Create a table for wxLuaCallbacks ! lua_pushlightuserdata(L, &wxlua_lreg_evtcallbacks_key); ! lua_newtable(L); ! lua_rawset( L, LUA_REGISTRYINDEX ); // set the value // Create a table for wxLuaWinDestroyCallbacks ! lua_pushlightuserdata(L, &wxlua_lreg_windestroycallbacks_key); ! lua_newtable(L); ! lua_rawset( L, LUA_REGISTRYINDEX ); // set the value // Create a table for top level wxWindows ! lua_pushlightuserdata(L, &wxlua_lreg_topwindows_key); ! lua_newtable(L); ! lua_rawset( L, LUA_REGISTRYINDEX ); // set the value if (WXLUA_HASBIT(state_type, wxLUASTATE_USESTATE)) --- 2091,2107 ---- lua_rawset(L, -3); // set mode of main table lua_setmetatable(L, -2); // via the metatable ! lua_pop(L, 1); // Create a table for objects to delete ! wxlua_lreg_createtable(L, &wxlua_lreg_delobjects_key); // Create a table for wxLuaCallbacks ! wxlua_lreg_createtable(L, &wxlua_lreg_evtcallbacks_key); // Create a table for wxLuaWinDestroyCallbacks ! wxlua_lreg_createtable(L, &wxlua_lreg_windestroycallbacks_key); // Create a table for top level wxWindows ! wxlua_lreg_createtable(L, &wxlua_lreg_topwindows_key); if (WXLUA_HASBIT(state_type, wxLUASTATE_USESTATE)) *************** *** 2160,2172 **** } ! void wxLuaState::SendEvent( wxLuaEvent &event ) const { ! wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! if (GetEventHandler()) { event.SetEventObject( (wxObject*)this ); ! GetEventHandler()->ProcessEvent(event); } } --- 2234,2248 ---- } ! bool wxLuaState::SendEvent( wxLuaEvent &event ) const { ! wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! if (M_WXLSTATEDATA->m_wxlStateData->m_evtHandler) { event.SetEventObject( (wxObject*)this ); ! return M_WXLSTATEDATA->m_wxlStateData->m_evtHandler->ProcessEvent(event); } + + return false; } *************** *** 2300,2305 **** int newtop = lua_gettop(L); - wxString errorMsg; if (!CheckRunError(status, &errorMsg)) { --- 2376,2381 ---- int newtop = lua_gettop(L); wxString errorMsg; + if (!CheckRunError(status, &errorMsg)) { *************** *** 2449,2453 **** // These are the various hooks you can install //LUA_MASKCALL, LUA_MASKRET, LUA_MASKLINE, and LUA_MASKCOUNT ! lua_sethook(GetLuaState(), wxlua_debugHookFunction, hook, count); } --- 2525,2529 ---- // These are the various hooks you can install //LUA_MASKCALL, LUA_MASKRET, LUA_MASKLINE, and LUA_MASKCOUNT ! lua_sethook(M_WXLSTATEDATA->m_lua_State, wxlua_debugHookFunction, hook, count); } *************** *** 2527,2542 **** // Finally - set the global tags from the bindings we've just installed ! const wxLuaBindClass* wxlClass = NULL; ! wxlClass = GetBindClass("wxEvent"); ! wxCHECK_RET(wxlClass, wxT("wxEvent Lua tag is missing in wxLuaState, forgot to add wxWidgets binding?")); ! g_wxluatag_wxEvent = *wxlClass->class_tag; ! ! wxlClass = GetBindClass("wxString"); ! wxCHECK_RET(wxlClass, wxT("wxString Lua tag is missing in wxLuaState, forgot to add wxWidgets binding?")); ! g_wxluatag_wxString = *wxlClass->class_tag; ! ! wxlClass = GetBindClass("wxWindow"); ! wxCHECK_RET(wxlClass, wxT("wxWindow Lua tag is missing in wxLuaState, forgot to add wxWidgets binding?")); ! g_wxluatag_wxWindow = *wxlClass->class_tag; } --- 2603,2612 ---- // Finally - set the global tags from the bindings we've just installed ! g_wxluatag_wxEvent = wxluaT_gettag(L, "wxEvent"); ! g_wxluatag_wxString = wxluaT_gettag(L, "wxString"); ! g_wxluatag_wxWindow = wxluaT_gettag(L, "wxWindow"); ! g_wxluatag_wxArrayString = wxluaT_gettag(L, "wxArrayString"); ! g_wxluatag_wxSortedArrayString = wxluaT_gettag(L, "wxSortedArrayString"); ! g_wxluatag_wxArrayInt = wxluaT_gettag(L, "wxArrayInt"); } *************** *** 2638,2669 **** wxArrayString wxLuaState::GetTrackedObjectStrings() { ! wxArrayString names; ! ! wxCHECK_MSG(Ok(), names, wxT("Invalid wxLuaState")); ! ! lua_State* L = M_WXLSTATEDATA->m_lua_State; ! ! lua_pushlightuserdata(L, &wxlua_lreg_delobjects_key); // push key ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) ! ! lua_pushnil(L); ! while (lua_next(L, -2) != 0) ! { ! // value = -1, key = -2, table = -3 ! wxString name(wxT("wxObject?")); ! ! wxObject* obj = (wxObject*)lua_touserdata(L, -1); ! if (obj && obj->GetClassInfo() && obj->GetClassInfo()->GetClassName()) ! name = obj->GetClassInfo()->GetClassName(); ! ! names.Add(wxString::Format(wxT("%s %p"), name.c_str(), obj)); ! ! lua_pop(L, 1); // pop value, lua_next will pop key at end ! } ! ! lua_pop(L, 1); // pop table ! ! names.Sort(); ! return names; } --- 2708,2713 ---- wxArrayString wxLuaState::GetTrackedObjectStrings() { ! wxCHECK_MSG(Ok(), wxArrayString(), wxT("Invalid wxLuaState")); ! return wxluaO_gettrackedobjectstrings(M_WXLSTATEDATA->m_lua_State); } *************** *** 2688,2716 **** wxArrayString wxLuaState::GetTrackedWindowStrings() const { ! wxArrayString names; ! ! wxCHECK_MSG(Ok(), names, wxT("Invalid wxLuaState")); ! lua_State* L = M_WXLSTATEDATA->m_lua_State; ! ! lua_pushlightuserdata(L, &wxlua_lreg_topwindows_key); // push key ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) ! ! lua_pushnil(L); ! while (lua_next(L, -2) != 0) ! { ! // value = -1, key = -2, table = -3 ! wxWindow* win = (wxWindow*)lua_touserdata(L, -2); ! wxCHECK_MSG(win, names, wxT("Invalid wxWindow")); ! ! wxString name(win->GetClassInfo()->GetClassName()); ! names.Add(wxString::Format(wxT("%s(%p id=%d)"), name.c_str(), win, win->GetId())); ! ! lua_pop(L, 1); // pop value, lua_next will pop key at end ! } ! ! lua_pop(L, 1); // pop table ! ! names.Sort(); ! return names; } --- 2732,2737 ---- wxArrayString wxLuaState::GetTrackedWindowStrings() const { ! wxCHECK_MSG(Ok(), wxArrayString(), wxT("Invalid wxLuaState")); ! return wxluaW_gettrackedwindowstrings(M_WXLSTATEDATA->m_lua_State); } *************** *** 3756,3760 **** { size_t i, count = pathlist.GetCount(); ! for (i = 0; i < count; i++) { wxFileName fname(pathlist[i]); --- 3777,3781 ---- { size_t i, count = pathlist.GetCount(); ! for (i = 0; i < count; ++i) { wxFileName fname(pathlist[i]); Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** wxlbind.cpp 8 Dec 2007 00:25:24 -0000 1.102 --- wxlbind.cpp 10 Dec 2007 05:39:10 -0000 1.103 *************** *** 41,49 **** int s_wxluaarg_CFunction = WXLUAARG_CFunction; ! int g_wxluatag_wxLuaFunction = 0; ! int g_wxluatag_NULL = 0; ! int g_wxluatag_wxEvent = 0; ! int g_wxluatag_wxWindow = 0; ! int g_wxluatag_wxString = 0; //----------------------------------------------------------------------------- --- 41,52 ---- int s_wxluaarg_CFunction = WXLUAARG_CFunction; ! int g_wxluatag_wxLuaFunction = WXLUA_NOTAG; ! int g_wxluatag_NULL = WXLUA_NOTAG; ! int g_wxluatag_wxEvent = WXLUA_NOTAG; ! int g_wxluatag_wxWindow = WXLUA_NOTAG; ! int g_wxluatag_wxString = WXLUA_NOTAG; ! int g_wxluatag_wxArrayString = WXLUA_NOTAG; ! int g_wxluatag_wxSortedArrayString = WXLUA_NOTAG; ! int g_wxluatag_wxArrayInt = WXLUA_NOTAG; //----------------------------------------------------------------------------- *************** *** 175,182 **** } - // If there was a function that matched run it, if > 1 ??? // Note that the top function is the one that is highest in the // derived functions from any baseclasses and should be the best choice. ! if (funcArray.GetCount() == 1) { lua_CFunction func = ((wxLuaBindCFunc*)funcArray[0])->func; --- 178,185 ---- } // Note that the top function is the one that is highest in the // derived functions from any baseclasses and should be the best choice. ! // Example is wxBookCtrlBaseEvent::GetSelection() and wxCommandEvent::GetSelection() ! if (funcArray.GetCount() > 0) { lua_CFunction func = ((wxLuaBindCFunc*)funcArray[0])->func; *************** *** 193,197 **** // Build an error message wxString fnCall = name + wxT("("); ! for (arg = 0; arg < arg_count; arg++) { if (arg > 0) fnCall += wxT(", "); --- 196,200 ---- // Build an error message wxString fnCall = name + wxT("("); ! for (arg = 0; arg < arg_count; ++arg) { if (arg > 0) fnCall += wxT(", "); *************** *** 214,218 **** wxString fnOverloadList = wxT("wxLua Function Overload Table:\n"); wxArrayString overloadMethodArray = wxlua_CreateMethodArgTagsMsg(L, wxlMethod); ! for (i = 0; i < (int)overloadMethodArray.GetCount(); i++) fnOverloadList += overloadMethodArray[i] + wxT("\n"); --- 217,221 ---- wxString fnOverloadList = wxT("wxLua Function Overload Table:\n"); wxArrayString overloadMethodArray = wxlua_CreateMethodArgTagsMsg(L, wxlMethod); ! for (i = 0; i < (int)overloadMethodArray.GetCount(); ++i) fnOverloadList += overloadMethodArray[i] + wxT("\n"); *************** *** 277,281 **** className = lua2wx(wxlClass->name) + wxT("::"); ! for (i = 0; i < funcs_count; i++) { i_func++; --- 280,284 ---- className = lua2wx(wxlClass->name) + wxT("::"); ! for (i = 0; i < funcs_count; ++i) { i_func++; *************** *** 292,296 **** else { ! for (arg = 0; arg < funcs[i].maxargs; arg++) { // optional args? --- 295,299 ---- else { ! for (arg = 0; arg < funcs[i].maxargs; ++arg) { // optional args? *************** *** 474,478 **** { public: ! wxLuaSmartwxArrayStringRefData(wxArrayString* arr, int del) : m_arr(arr), m_delete(del) { if (!m_arr) { m_arr = new wxArrayString; m_delete = true; } // always exists --- 477,481 ---- { public: ! wxLuaSmartwxArrayStringRefData(wxArrayString* arr, int del) : m_arr(arr), m_delete(del) { if (!m_arr) { m_arr = new wxArrayString; m_delete = true; } // always exists *************** *** 483,490 **** wxArrayString *m_arr; bool m_delete; ! }; wxLuaSmartwxArrayString::wxLuaSmartwxArrayString(wxArrayString *arr, bool del) ! { m_refData = new wxLuaSmartwxArrayStringRefData(arr, del); } --- 486,493 ---- wxArrayString *m_arr; bool m_delete; ! }; wxLuaSmartwxArrayString::wxLuaSmartwxArrayString(wxArrayString *arr, bool del) ! { m_refData = new wxLuaSmartwxArrayStringRefData(arr, del); } *************** *** 501,505 **** { public: ! wxLuaSmartwxSortedArrayStringRefData(wxSortedArrayString* arr, int del) : m_arr(arr), m_delete(del) { if (!m_arr) { m_arr = new wxSortedArrayString; m_delete = true; } // always exists --- 504,508 ---- { public: ! wxLuaSmartwxSortedArrayStringRefData(wxSortedArrayString* arr, int del) : m_arr(arr), m_delete(del) { if (!m_arr) { m_arr = new wxSortedArrayString; m_delete = true; } // always exists *************** *** 510,517 **** wxSortedArrayString *m_arr; bool m_delete; ! }; wxLuaSmartwxSortedArrayString::wxLuaSmartwxSortedArrayString(wxSortedArrayString *arr, bool del) ! { m_refData = new wxLuaSmartwxSortedArrayStringRefData(arr, del); } --- 513,520 ---- wxSortedArrayString *m_arr; bool m_delete; ! }; wxLuaSmartwxSortedArrayString::wxLuaSmartwxSortedArrayString(wxSortedArrayString *arr, bool del) ! { m_refData = new wxLuaSmartwxSortedArrayStringRefData(arr, del); } *************** *** 540,544 **** wxLuaSmartwxArrayInt::wxLuaSmartwxArrayInt(wxArrayInt *arr, bool del) ! { m_refData = new wxLuaSmartwxArrayIntRefData(arr, del); } --- 543,547 ---- wxLuaSmartwxArrayInt::wxLuaSmartwxArrayInt(wxArrayInt *arr, bool del) ! { m_refData = new wxLuaSmartwxArrayIntRefData(arr, del); } Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** wxlcallb.cpp 7 Dec 2007 06:44:46 -0000 1.48 --- wxlcallb.cpp 10 Dec 2007 05:39:10 -0000 1.49 *************** *** 139,142 **** --- 139,145 ---- event_tag = g_wxluatag_wxEvent; // get the s_wxluatag_wxEvent + // Should never get here, but error out in case we do + wxCHECK_RET(event_tag != WXLUA_NOTAG, wxT("Unknown wxEvent wxLua tag for : ") + wxString(event->GetClassInfo()->GetClassName())); + wxlState.lua_CheckStack(LUA_MINSTACK); int oldTop = wxlState.lua_GetTop(); Index: wxlua_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua_bind.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wxlua_bind.cpp 7 Dec 2007 06:44:47 -0000 1.14 --- wxlua_bind.cpp 10 Dec 2007 05:39:10 -0000 1.15 *************** *** 775,779 **** static int LUACALL wxLua_function_iswxluatype(lua_State *L) { - int returns; // int wxluaarg_tag int wxluaarg_tag = (int)wxlua_getnumbertype(L, 2); --- 775,778 ---- *************** *** 781,785 **** int luatype = (int)wxlua_getnumbertype(L, 1); // call wxlua_iswxluatype ! returns = (wxlua_iswxluatype(luatype, wxluaarg_tag)); // push the result number lua_pushnumber(L, returns); --- 780,784 ---- int luatype = (int)wxlua_getnumbertype(L, 1); // call wxlua_iswxluatype ! int returns = (wxlua_iswxluatype(luatype, wxluaarg_tag)); // push the result number lua_pushnumber(L, returns); *************** *** 843,847 **** static int LUACALL wxLua_function_wxLUA_CHECK_VERSION(lua_State *L) { - bool returns; // int release int release = (int)wxlua_getnumbertype(L, 3); --- 842,845 ---- *************** *** 851,855 **** int major = (int)wxlua_getnumbertype(L, 1); // call wxLUA_CHECK_VERSION ! returns = (wxLUA_CHECK_VERSION(major, minor, release)); // push the result flag lua_pushboolean(L, returns); --- 849,853 ---- int major = (int)wxlua_getnumbertype(L, 1); // call wxLUA_CHECK_VERSION ! bool returns = (wxLUA_CHECK_VERSION(major, minor, release)); // push the result flag lua_pushboolean(L, returns); *************** *** 863,867 **** static int LUACALL wxLua_function_wxLUA_CHECK_VERSION_FULL(lua_State *L) { - bool returns; // int subrel int subrel = (int)wxlua_getnumbertype(L, 4); --- 861,864 ---- *************** *** 873,877 **** int major = (int)wxlua_getnumbertype(L, 1); // call wxLUA_CHECK_VERSION_FULL ! returns = (wxLUA_CHECK_VERSION_FULL(major, minor, release, subrel)); // push the result flag lua_pushboolean(L, returns); --- 870,874 ---- int major = (int)wxlua_getnumbertype(L, 1); // call wxLUA_CHECK_VERSION_FULL ! bool returns = (wxLUA_CHECK_VERSION_FULL(major, minor, release, subrel)); // push the result flag lua_pushboolean(L, returns); *************** *** 927,944 **** } - // --------------------------------------------------------------------------- // wxLuaBinding_wxlua() - the binding class // --------------------------------------------------------------------------- - // binding class - extern wxLuaBindClass *wxLuaGetClassList_wxlua(size_t &count); - extern wxLuaBindDefine *wxLuaGetDefineList_wxlua(size_t &count); - extern wxLuaBindString *wxLuaGetStringList_wxlua(size_t &count); - extern wxLuaBindEvent *wxLuaGetEventList_wxlua(size_t &count); - extern wxLuaBindObject *wxLuaGetObjectList_wxlua(size_t &count); - extern wxLuaBindMethod *wxLuaGetFunctionList_wxlua(size_t &count); - - IMPLEMENT_DYNAMIC_CLASS(wxLuaBinding_wxlua, wxLuaBinding) --- 924,931 ---- *************** *** 963,968 **** } - // bind wxLuaBinding_wxlua to a single wxLuaState bool wxLuaBinding_wxlua_bind(const wxLuaState& wxlState_) { --- 950,955 ---- } + // --------------------------------------------------------------------------- bool wxLuaBinding_wxlua_bind(const wxLuaState& wxlState_) { *************** *** 981,985 **** return true; } ! // initialize wxLuaBinding_wxlua for all wxLuaStates bool wxLuaBinding_wxlua_init() { --- 968,972 ---- return true; } ! bool wxLuaBinding_wxlua_init() { |
From: John L. <jr...@us...> - 2007-12-10 05:39:22
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23281/wxLua/modules/wxluadebug/src Modified Files: wxldebug.cpp wxlstack.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: wxlstack.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wxlstack.cpp 7 Dec 2007 02:13:14 -0000 1.25 --- wxlstack.cpp 10 Dec 2007 05:39:10 -0000 1.26 *************** *** 671,675 **** } ! m_batch_count++; } --- 671,675 ---- } ! ++m_batch_count; } *************** *** 691,695 **** wxLuaStackListData* stkListData_n = NULL; ! for (n = 0; n < count; n++) { stkListData_n = (wxLuaStackListData*)m_listData[n]; --- 691,695 ---- wxLuaStackListData* stkListData_n = NULL; ! for (n = 0; n < count; ++n) { stkListData_n = (wxLuaStackListData*)m_listData[n]; *************** *** 842,851 **** { i = (direction > 0) ? 0 : list_count - 1; ! wrap_count++; // we're looking at all the elements } else if ((direction > 0) && (start_item == list_count - 1)) { i = 0; ! wrap_count++; // we're looking at all the elements } } --- 842,851 ---- { i = (direction > 0) ? 0 : list_count - 1; ! ++wrap_count; // we're looking at all the elements } else if ((direction > 0) && (start_item == list_count - 1)) { i = 0; ! ++wrap_count; // we're looking at all the elements } } *************** *** 857,861 **** for ( ; (i >= 0) && (i < list_count) && !found; i = i + direction) { ! for (int col = 0; (col < 5) && !found; col++) { if (!find_col[col]) continue; --- 857,861 ---- for ( ; (i >= 0) && (i < list_count) && !found; i = i + direction) { ! for (int col = 0; (col < 5) && !found; ++col) { if (!find_col[col]) continue; *************** *** 876,880 **** } ! wrap_count++; } } --- 876,880 ---- } ! ++wrap_count; } } *************** *** 1060,1065 **** bool expanded = false; ! wxProgressDialog dlg(wxT("wxLua Stack Expanding node"), wxEmptyString, 100, this, ! wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT); BeginBatch(); --- 1060,1066 ---- bool expanded = false; ! wxProgressDialog* dlg = ! new wxProgressDialog(wxT("wxLua Stack Expanding node"), wxEmptyString, 100, this, ! wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT); BeginBatch(); *************** *** 1077,1081 **** // show message for first item only so it doesn't silently fail if (n > lc_item) m_show_dup_expand_msg = false; ! wxLuaStackListData* stkListData_n = (wxLuaStackListData*)m_listData[n]; --- 1078,1082 ---- // show message for first item only so it doesn't silently fail if (n > lc_item) m_show_dup_expand_msg = false; ! wxLuaStackListData* stkListData_n = (wxLuaStackListData*)m_listData[n]; *************** *** 1084,1088 **** if (counter % 20 == 0) { ! if (!dlg.Pulse(wxString::Format(wxT("Expanding nodes : %d"), counter))) break; } --- 1085,1089 ---- if (counter % 20 == 0) { ! if (!dlg->Pulse(wxString::Format(wxT("Expanding nodes : %d"), counter))) break; } *************** *** 1091,1098 **** expanded |= ExpandItem(n); ! counter++; ! n++; } EndBatch(); m_show_dup_expand_msg = true; --- 1092,1101 ---- expanded |= ExpandItem(n); ! ++counter; ! ++n; } + dlg->Destroy(); + EndBatch(); m_show_dup_expand_msg = true; *************** *** 1123,1127 **** long n, count = m_listCtrl->GetItemCount(); ! for (n = lc_item+1; n < count; n++) { wxLuaStackListData* stkListData_n = (wxLuaStackListData*)m_listData[n]; --- 1126,1130 ---- long n, count = m_listCtrl->GetItemCount(); ! for (n = lc_item+1; n < count; ++n) { wxLuaStackListData* stkListData_n = (wxLuaStackListData*)m_listData[n]; *************** *** 1230,1237 **** */ // remove the last to so we don't make any holes for (i = (int)m_luaReferences.GetCount()-1; i >= 0; --i) { ! bool ok = m_wxlState.wxluaR_Unref(m_luaReferences[i], &wxlua_lreg_debug_refs_key); wxCHECK_RET(ok, wxT("Unable to remove a reference in Lua")); //wxPrintf(wxT("Extra Lua reference in listctrl #%d ok %d ref %d count %d\n"), i, ok, m_luaReferences[i], m_luaReferences.GetCount()); --- 1233,1242 ---- */ + lua_State* L = m_wxlState.GetLuaState(); + // remove the last to so we don't make any holes for (i = (int)m_luaReferences.GetCount()-1; i >= 0; --i) { ! bool ok = wxluaR_unref(L, m_luaReferences[i], &wxlua_lreg_debug_refs_key); wxCHECK_RET(ok, wxT("Unable to remove a reference in Lua")); //wxPrintf(wxT("Extra Lua reference in listctrl #%d ok %d ref %d count %d\n"), i, ok, m_luaReferences[i], m_luaReferences.GetCount()); *************** *** 1244,1248 **** // There should be only one of us created at any time. - lua_State* L = m_wxlState.GetLuaState(); //wxLuaCheckStack cs(L, wxT("wxLuaStackDialog::RemoveAllLuaReferences")); lua_pushlightuserdata(L, &wxlua_lreg_debug_refs_key); // push name of table to get as key --- 1249,1252 ---- *************** *** 1264,1276 **** // Clear out the old numeric references since it should be "empty" ! // though full of table[idx]=next_idx, where table[0] = 1; ! ! lua_pushlightuserdata(L, &wxlua_lreg_debug_refs_key); // push name of table to get as key ! lua_pushnil(L); ! lua_rawset(L, LUA_REGISTRYINDEX); // clear the table completely ! // create the debug refs table in registry ! lua_pushlightuserdata(L, &wxlua_lreg_debug_refs_key); ! lua_newtable(L); ! lua_rawset(L, LUA_REGISTRYINDEX); // set the value } --- 1268,1273 ---- // Clear out the old numeric references since it should be "empty" ! // though full of dead table[idx]=next_idx, where table[0] = 1; ! wxlua_lreg_createtable(L, &wxlua_lreg_debug_refs_key); } Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** wxldebug.cpp 7 Dec 2007 02:13:14 -0000 1.56 --- wxldebug.cpp 10 Dec 2007 05:39:10 -0000 1.57 *************** *** 173,177 **** // skip stack frames that do not have line number, always add first int currentLine = luaDebug.currentline; ! if (1) //(count == 0) || (currentLine != -1)) { wxString name; --- 173,177 ---- // skip stack frames that do not have line number, always add first int currentLine = luaDebug.currentline; ! if ((count == 0) || (currentLine != -1)) { wxString name; *************** *** 187,191 **** Add(new wxLuaDebugItem(name, WXLUAARG_None, wxT(""), WXLUAARG_None, source, LUA_NOREF, stack_frame, 0)); ! count++; } } --- 187,191 ---- Add(new wxLuaDebugItem(name, WXLUAARG_None, wxT(""), WXLUAARG_None, source, LUA_NOREF, stack_frame, 0)); ! ++count; } } *************** *** 234,238 **** Add(new wxLuaDebugItem(name, WXLUAARG_None, value, wxl_valuetype, source, nRef, 0, flag_type)); ! count++; name = lua2wx(lua_getlocal(L, &luaDebug, ++stack_idx)); --- 234,238 ---- Add(new wxLuaDebugItem(name, WXLUAARG_None, value, wxl_valuetype, source, nRef, 0, flag_type)); ! ++count; name = lua2wx(lua_getlocal(L, &luaDebug, ++stack_idx)); *************** *** 284,322 **** if (wxlState.wxluaR_GetRef(tableRef, &wxlua_lreg_debug_refs_key)) { ! bool is_wxlua_lreg_evtcallbacks_key = false; ! bool is_wxlua_lreg_windestroycallbacks_key = false; ! bool is_wxlua_lreg_topwindows_key = false; ! bool is_wxlua_lreg_delobjects_key = false; ! ! // See if this is one of wxLua's registry tables ! lua_pushlightuserdata(L, &wxlua_lreg_evtcallbacks_key); // push key ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) ! is_wxlua_lreg_evtcallbacks_key = lua_equal(L, -1, -2); ! lua_pop(L, 1); ! ! if (!is_wxlua_lreg_evtcallbacks_key) ! { ! lua_pushlightuserdata(L, &wxlua_lreg_windestroycallbacks_key); // push key ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) ! is_wxlua_lreg_windestroycallbacks_key = lua_equal(L, -1, -2); ! lua_pop(L, 1); ! ! if (!is_wxlua_lreg_windestroycallbacks_key) ! { ! lua_pushlightuserdata(L, &wxlua_lreg_topwindows_key); // push key ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) ! is_wxlua_lreg_topwindows_key = lua_equal(L, -1, -2); ! lua_pop(L, 1); ! ! if (!is_wxlua_lreg_topwindows_key) ! { ! lua_pushlightuserdata(L, &wxlua_lreg_delobjects_key); // push key ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) ! is_wxlua_lreg_delobjects_key = lua_equal(L, -1, -2); ! lua_pop(L, 1); ! } ! } ! } if (lua_getmetatable(L, -1)) // if no metatable then nothing is pushed { --- 284,297 ---- if (wxlState.wxluaR_GetRef(tableRef, &wxlua_lreg_debug_refs_key)) { ! // Check to see if this is a wxLua LUA_REGISTRYINDEX table ! void *lightuserdata_reg_key = NULL; ! lua_pushlightuserdata(L, &wxlua_lreg_regtable_key); // push key ! lua_rawget(L, LUA_REGISTRYINDEX); ! lua_pushvalue(L, -2); // push value (table we're iterating) ! lua_rawget(L, -2); ! lightuserdata_reg_key = lua_touserdata(L, -1); ! lua_pop(L, 2); // pop wxlua_lreg_regtable_key table and (nil or lightuserdata) + // Check if it has a metatable if (lua_getmetatable(L, -1)) // if no metatable then nothing is pushed { *************** *** 327,332 **** int nRef = RefTable(L, -1, &flag_type, references); Add(new wxLuaDebugItem(wxT(" __metatable"), WXLUAARG_Table, value, wxl_valuetype, wxT(""), nRef, nIndex, flag_type)); ! count++; lua_pop(L, 1); // pop metatable --- 302,308 ---- int nRef = RefTable(L, -1, &flag_type, references); + // leading space so it's first when sorted Add(new wxLuaDebugItem(wxT(" __metatable"), WXLUAARG_Table, value, wxl_valuetype, wxT(""), nRef, nIndex, flag_type)); ! ++count; lua_pop(L, 1); // pop metatable *************** *** 344,383 **** GetTypeValue(wxlState, -1, &wxl_valuetype, value); ! // Handle special tables to give more information ! if (is_wxlua_lreg_evtcallbacks_key) { ! wxLuaCallback* wxlCallback = (wxLuaCallback*)lua_touserdata(L, -2); ! wxCHECK_MSG(wxlCallback, count, wxT("Invalid wxLuaCallback")); ! wxString s(wxlCallback->GetInfo()); ! name = s.BeforeFirst(wxT('|')); ! value = s.AfterFirst(wxT('|')); ! } ! else if (is_wxlua_lreg_windestroycallbacks_key && (lua_type(L, -1) == LUA_TLIGHTUSERDATA)) ! { ! // only handle t[wxWindow*] = wxLuaWinDestroyCallback* ! wxLuaWinDestroyCallback* wxlDestroyCallBack = (wxLuaWinDestroyCallback*)lua_touserdata(L, -1); ! wxCHECK_MSG(wxlDestroyCallBack, count, wxT("Invalid wxLuaWinDestroyCallback")); ! wxString s(wxlDestroyCallBack->GetInfo()); ! name = s.BeforeFirst(wxT('|')); ! value = s.AfterFirst(wxT('|')); ! } ! else if (is_wxlua_lreg_topwindows_key) ! { ! wxWindow* win = (wxWindow*)lua_touserdata(L, -2); ! name += wxT(" ") + wxString(win->GetClassInfo()->GetClassName()); ! } ! else if (is_wxlua_lreg_delobjects_key) ! { ! wxObject* obj = (wxObject*)lua_touserdata(L, -1); ! name = wxString(obj->GetClassInfo()->GetClassName()) + wxT("(") + name + wxT(")"); } int flag_type = 0; ! int nRef = RefTable(L, -1, &flag_type, references); Add(new wxLuaDebugItem(name, wxl_keytype, value, wxl_valuetype, wxT(""), nRef, nIndex, flag_type)); ! count++; lua_pop(L, 1); // pop value, leave key --- 320,370 ---- GetTypeValue(wxlState, -1, &wxl_valuetype, value); ! // Handle wxLua LUA_REGISTRYINDEX tables to give more information ! if (lightuserdata_reg_key != NULL) { ! if (lightuserdata_reg_key == &wxlua_lreg_tags_key) ! { ! value += wxT(" (") + wxluaT_gettagname(L, (int)lua_tonumber(L, -2)) + wxT(")"); ! } ! else if (lightuserdata_reg_key == &wxlua_lreg_evtcallbacks_key) ! { ! wxLuaCallback* wxlCallback = (wxLuaCallback*)lua_touserdata(L, -2); ! wxCHECK_MSG(wxlCallback, count, wxT("Invalid wxLuaCallback")); ! wxString s(wxlCallback->GetInfo()); ! name = s.BeforeFirst(wxT('|')); ! value = s.AfterFirst(wxT('|')); ! } ! else if ((lightuserdata_reg_key == &wxlua_lreg_windestroycallbacks_key) && ! (lua_type(L, -1) == LUA_TLIGHTUSERDATA)) ! { ! // only handle t[wxWindow*] = wxLuaWinDestroyCallback* ! wxLuaWinDestroyCallback* wxlDestroyCallBack = (wxLuaWinDestroyCallback*)lua_touserdata(L, -1); ! wxCHECK_MSG(wxlDestroyCallBack, count, wxT("Invalid wxLuaWinDestroyCallback")); ! wxString s(wxlDestroyCallBack->GetInfo()); ! name = s.BeforeFirst(wxT('|')); ! value = s.AfterFirst(wxT('|')); ! } ! else if (lightuserdata_reg_key == &wxlua_lreg_topwindows_key) ! { ! wxWindow* win = (wxWindow*)lua_touserdata(L, -2); ! name += wxT(" ") + wxString(win->GetClassInfo()->GetClassName()); ! } ! else if (lightuserdata_reg_key == &wxlua_lreg_delobjects_key) ! { ! wxObject* obj = (wxObject*)lua_touserdata(L, -1); ! name = wxString(obj->GetClassInfo()->GetClassName()) + wxT("(") + name + wxT(")"); ! } } int flag_type = 0; ! int nRef = LUA_NOREF; ! // don't ref anything in this table since it's already refed ! if (lightuserdata_reg_key != &wxlua_lreg_debug_refs_key) ! nRef = RefTable(L, -1, &flag_type, references); Add(new wxLuaDebugItem(name, wxl_keytype, value, wxl_valuetype, wxT(""), nRef, nIndex, flag_type)); ! ++count; lua_pop(L, 1); // pop value, leave key *************** *** 398,402 **** if (lua_istable(L, stack_idx)) { ! nRef = wxluaR_isrefed(L, stack_idx, &wxlua_lreg_debug_refs_key); // don't duplicate refs if (nRef == LUA_NOREF) --- 385,389 ---- if (lua_istable(L, stack_idx)) { ! //nRef = wxluaR_isrefed(L, stack_idx, &wxlua_lreg_debug_refs_key); // don't duplicate refs if (nRef == LUA_NOREF) *************** *** 538,541 **** --- 525,529 ---- (udata == &wxlua_lreg_wxeventtype_key) || (udata == &wxlua_lreg_wxluadebughookdata_key) || + (udata == &wxlua_lreg_regtable_key) || (udata == &wxlua_metatable_tag_key) || |
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23281/wxLua/modules/wxbind/src Modified Files: wxadv_adv.cpp wxadv_bind.cpp wxadv_grid.cpp wxaui_aui.cpp wxaui_bind.cpp wxbase_base.cpp wxbase_bind.cpp wxbase_config.cpp wxbase_data.cpp wxbase_datetime.cpp wxbase_file.cpp wxcore_appframe.cpp wxcore_bind.cpp wxcore_clipdrag.cpp wxcore_controls.cpp wxcore_core.cpp wxcore_defsutils.cpp wxcore_dialogs.cpp wxcore_event.cpp wxcore_gdi.cpp wxcore_geometry.cpp wxcore_help.cpp wxcore_image.cpp wxcore_mdi.cpp wxcore_menutool.cpp wxcore_picker.cpp wxcore_print.cpp wxcore_sizer.cpp wxcore_windows.cpp wxcore_wxlprint.cpp wxgl_bind.cpp wxgl_gl.cpp wxhtml_bind.cpp wxhtml_html.cpp wxmedia_bind.cpp wxmedia_media.cpp wxnet_bind.cpp wxnet_net.cpp wxrichtext_bind.cpp wxstc_bind.cpp wxstc_stc.cpp wxxml_bind.cpp wxxml_xml.cpp wxxrc_bind.cpp wxxrc_xrc.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: wxxrc_xrc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxrc_xrc.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxxrc_xrc.cpp 7 Dec 2007 06:44:46 -0000 1.5 --- wxxrc_xrc.cpp 10 Dec 2007 05:39:09 -0000 1.6 *************** *** 35,39 **** static int LUACALL wxLua_wxXmlResource_AttachUnknownControl(lua_State *L) { - bool returns; // get number of arguments int argCount = lua_gettop(L); --- 35,38 ---- *************** *** 47,51 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call AttachUnknownControl ! returns = (self->AttachUnknownControl(name, control, parent)); // push the result flag lua_pushboolean(L, returns); --- 46,50 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call AttachUnknownControl ! bool returns = (self->AttachUnknownControl(name, control, parent)); // push the result flag lua_pushboolean(L, returns); *************** *** 74,78 **** static int LUACALL wxLua_wxXmlResource_CompareVersion(lua_State *L) { - int returns; // int revision int revision = (int)wxlua_getnumbertype(L, 5); --- 73,76 ---- *************** *** 86,90 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call CompareVersion ! returns = (self->CompareVersion(major, minor, release, revision)); // push the result number lua_pushnumber(L, returns); --- 84,88 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call CompareVersion ! int returns = (self->CompareVersion(major, minor, release, revision)); // push the result number lua_pushnumber(L, returns); *************** *** 98,104 **** static int LUACALL wxLua_wxXmlResource_Get(lua_State *L) { - wxXmlResource *returns; // call Get ! returns = (wxXmlResource *)wxXmlResource::Get(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); --- 96,101 ---- static int LUACALL wxLua_wxXmlResource_Get(lua_State *L) { // call Get ! wxXmlResource* returns = (wxXmlResource*)wxXmlResource::Get(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); *************** *** 113,121 **** static int LUACALL wxLua_wxXmlResource_GetFlags(lua_State *L) { - int returns; // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call GetFlags ! returns = (self->GetFlags()); // push the result number lua_pushnumber(L, returns); --- 110,117 ---- static int LUACALL wxLua_wxXmlResource_GetFlags(lua_State *L) { // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call GetFlags ! int returns = (self->GetFlags()); // push the result number lua_pushnumber(L, returns); *************** *** 130,138 **** static int LUACALL wxLua_wxXmlResource_GetVersion(lua_State *L) { - long returns; // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call GetVersion ! returns = (self->GetVersion()); // push the result number lua_pushnumber(L, returns); --- 126,133 ---- static int LUACALL wxLua_wxXmlResource_GetVersion(lua_State *L) { // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call GetVersion ! long returns = (self->GetVersion()); // push the result number lua_pushnumber(L, returns); *************** *** 147,151 **** static int LUACALL wxLua_wxXmlResource_GetXRCID(lua_State *L) { - int returns; // get number of arguments int argCount = lua_gettop(L); --- 142,145 ---- *************** *** 155,159 **** const wxString stringID = wxlua_getwxStringtype(L, 1); // call GetXRCID ! returns = (wxXmlResource::GetXRCID(stringID, value_if_not_found)); // push the result number lua_pushnumber(L, returns); --- 149,153 ---- const wxString stringID = wxlua_getwxStringtype(L, 1); // call GetXRCID ! int returns = (wxXmlResource::GetXRCID(stringID, value_if_not_found)); // push the result number lua_pushnumber(L, returns); *************** *** 182,186 **** static int LUACALL wxLua_wxXmlResource_Load(lua_State *L) { - bool returns; // const wxString filemask const wxString filemask = wxlua_getwxStringtype(L, 2); --- 176,179 ---- *************** *** 188,192 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call Load ! returns = (self->Load(filemask)); // push the result flag lua_pushboolean(L, returns); --- 181,185 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call Load ! bool returns = (self->Load(filemask)); // push the result flag lua_pushboolean(L, returns); *************** *** 203,207 **** static int LUACALL wxLua_wxXmlResource_LoadBitmap(lua_State *L) { - wxBitmap *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 2); --- 196,199 ---- *************** *** 210,216 **** // call LoadBitmap // allocate a new object using the copy constructor ! returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxBitmap *)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxBitmap, returns); --- 202,208 ---- // call LoadBitmap // allocate a new object using the copy constructor ! wxBitmap* returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxBitmap*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxBitmap, returns); *************** *** 228,232 **** static int LUACALL wxLua_wxXmlResource_LoadDialog1(lua_State *L) { - bool returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 4); --- 220,223 ---- *************** *** 238,242 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadDialog ! returns = (self->LoadDialog(dlg, parent, name)); // push the result flag lua_pushboolean(L, returns); --- 229,233 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadDialog ! bool returns = (self->LoadDialog(dlg, parent, name)); // push the result flag lua_pushboolean(L, returns); *************** *** 251,255 **** static int LUACALL wxLua_wxXmlResource_LoadDialog(lua_State *L) { - wxDialog *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 3); --- 242,245 ---- *************** *** 259,263 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadDialog ! returns = (wxDialog *)self->LoadDialog(parent, name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxDialog, returns); --- 249,253 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadDialog ! wxDialog* returns = (wxDialog*)self->LoadDialog(parent, name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxDialog, returns); *************** *** 275,279 **** static int LUACALL wxLua_wxXmlResource_LoadFrame(lua_State *L) { - bool returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 4); --- 265,268 ---- *************** *** 285,289 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadFrame ! returns = (self->LoadFrame(frame, parent, name)); // push the result flag lua_pushboolean(L, returns); --- 274,278 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadFrame ! bool returns = (self->LoadFrame(frame, parent, name)); // push the result flag lua_pushboolean(L, returns); *************** *** 301,305 **** static int LUACALL wxLua_wxXmlResource_LoadIcon(lua_State *L) { - wxIcon *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 2); --- 290,293 ---- *************** *** 308,314 **** // call LoadIcon // allocate a new object using the copy constructor ! returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxIcon *)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxIcon, returns); --- 296,302 ---- // call LoadIcon // allocate a new object using the copy constructor ! wxIcon* returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxIcon*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxIcon, returns); *************** *** 326,330 **** static int LUACALL wxLua_wxXmlResource_LoadMenu(lua_State *L) { - wxMenu *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 2); --- 314,317 ---- *************** *** 332,336 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenu ! returns = (wxMenu *)self->LoadMenu(name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxMenu, returns); --- 319,323 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenu ! wxMenu* returns = (wxMenu*)self->LoadMenu(name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxMenu, returns); *************** *** 345,349 **** static int LUACALL wxLua_wxXmlResource_LoadMenuBar1(lua_State *L) { - wxMenuBar *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 2); --- 332,335 ---- *************** *** 351,355 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenuBar ! returns = (wxMenuBar *)self->LoadMenuBar(name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxMenuBar, returns); --- 337,341 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenuBar ! wxMenuBar* returns = (wxMenuBar*)self->LoadMenuBar(name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxMenuBar, returns); *************** *** 364,368 **** static int LUACALL wxLua_wxXmlResource_LoadMenuBar(lua_State *L) { - wxMenuBar *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 3); --- 350,353 ---- *************** *** 372,376 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenuBar ! returns = (wxMenuBar *)self->LoadMenuBar(parent, name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxMenuBar, returns); --- 357,361 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenuBar ! wxMenuBar* returns = (wxMenuBar*)self->LoadMenuBar(parent, name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxMenuBar, returns); *************** *** 387,391 **** static int LUACALL wxLua_wxXmlResource_LoadPanel1(lua_State *L) { - bool returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 4); --- 372,375 ---- *************** *** 397,401 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadPanel ! returns = (self->LoadPanel(panel, parent, name)); // push the result flag lua_pushboolean(L, returns); --- 381,385 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadPanel ! bool returns = (self->LoadPanel(panel, parent, name)); // push the result flag lua_pushboolean(L, returns); *************** *** 410,414 **** static int LUACALL wxLua_wxXmlResource_LoadPanel(lua_State *L) { - wxPanel *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 3); --- 394,397 ---- *************** *** 418,422 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadPanel ! returns = (wxPanel *)self->LoadPanel(parent, name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxPanel, returns); --- 401,405 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadPanel ! wxPanel* returns = (wxPanel*)self->LoadPanel(parent, name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxPanel, returns); *************** *** 433,437 **** static int LUACALL wxLua_wxXmlResource_LoadToolBar(lua_State *L) { - wxToolBar *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 3); --- 416,419 ---- *************** *** 441,445 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadToolBar ! returns = (wxToolBar *)self->LoadToolBar(parent, name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxToolBar, returns); --- 423,427 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadToolBar ! wxToolBar* returns = (wxToolBar*)self->LoadToolBar(parent, name); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxToolBar, returns); *************** *** 456,465 **** static int LUACALL wxLua_wxXmlResource_Set(lua_State *L) { - wxXmlResource *returns; // wxXmlResource res wxXmlResource * res = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); if (wxluaO_istrackedobject(L, res)) wxluaO_removetrackedobject(L, res, wxLUA_UNDELETE_OBJECT); // call Set ! returns = (wxXmlResource *)wxXmlResource::Set(res); if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, returns); // push the result datatype --- 438,446 ---- static int LUACALL wxLua_wxXmlResource_Set(lua_State *L) { // wxXmlResource res wxXmlResource * res = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); if (wxluaO_istrackedobject(L, res)) wxluaO_removetrackedobject(L, res, wxLUA_UNDELETE_OBJECT); // call Set ! wxXmlResource* returns = (wxXmlResource*)wxXmlResource::Set(res); if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, returns); // push the result datatype *************** *** 507,511 **** static int LUACALL wxLua_wxXmlResource_Unload(lua_State *L) { - bool returns; // const wxString filename const wxString filename = wxlua_getwxStringtype(L, 2); --- 488,491 ---- *************** *** 513,517 **** wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call Unload ! returns = (self->Unload(filename)); // push the result flag lua_pushboolean(L, returns); --- 493,497 ---- wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call Unload ! bool returns = (self->Unload(filename)); // push the result flag lua_pushboolean(L, returns); *************** *** 542,546 **** { wxluabind_removetableforcall(L); - wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); --- 522,525 ---- *************** *** 552,556 **** const wxString filemask = wxlua_getwxStringtype(L, 1); // call constructor ! returns = new wxXmlResource(filemask, flags, domain); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 531,535 ---- const wxString filemask = wxlua_getwxStringtype(L, 1); // call constructor ! wxXmlResource* returns = new wxXmlResource(filemask, flags, domain); // add to tracked memory list wxluaO_addtrackedobject(L, returns); *************** *** 568,572 **** { wxluabind_removetableforcall(L); - wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); --- 547,550 ---- *************** *** 576,580 **** int flags = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxXRC_USE_LOCALE); // call constructor ! returns = new wxXmlResource(flags, domain); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 554,558 ---- int flags = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxXRC_USE_LOCALE); // call constructor ! wxXmlResource* returns = new wxXmlResource(flags, domain); // add to tracked memory list wxluaO_addtrackedobject(L, returns); Index: wxstc_stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxstc_stc.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxstc_stc.cpp 7 Dec 2007 06:44:46 -0000 1.6 --- wxstc_stc.cpp 10 Dec 2007 05:39:08 -0000 1.7 *************** *** 113,121 **** static int LUACALL wxLua_wxStyledTextCtrl_AutoCompActive(lua_State *L) { - bool returns; // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); // call AutoCompActive ! returns = (self->AutoCompActive()); // push the result flag lua_pushboolean(L, returns); --- 113,120 ---- [...3601 lines suppressed...] *** 8861,8865 **** { wxluabind_removetableforcall(L); - wxStyledTextEvent *returns; // get number of arguments int argCount = lua_gettop(L); --- 8685,8688 ---- *************** *** 8869,8873 **** wxEventType commandType = (argCount >= 1 ? (wxEventType)wxlua_getnumbertype(L, 1) : 0); // call constructor ! returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 8692,8696 ---- wxEventType commandType = (argCount >= 1 ? (wxEventType)wxlua_getnumbertype(L, 1) : 0); // call constructor ! wxStyledTextEvent* returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list wxluaO_addtrackedobject(L, returns); Index: wxnet_net.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxnet_net.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxnet_net.cpp 7 Dec 2007 06:44:46 -0000 1.5 --- wxnet_net.cpp 10 Dec 2007 05:39:08 -0000 1.6 *************** *** 49,57 **** static int LUACALL wxLua_wxSocketBase_Destroy(lua_State *L) { - bool returns; // get this wxSocketBase * self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketBase); // call Destroy ! returns = (self->Destroy()); // push the result flag lua_pushboolean(L, returns); --- 49,56 ---- [...1948 lines suppressed...] *************** *** 2927,2935 **** { wxluabind_removetableforcall(L); - wxURL *returns; // const wxString sUrl const wxString sUrl = wxlua_getwxStringtype(L, 1); // call constructor ! returns = new wxURL(sUrl); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 2830,2837 ---- { wxluabind_removetableforcall(L); // const wxString sUrl const wxString sUrl = wxlua_getwxStringtype(L, 1); // call constructor ! wxURL* returns = new wxURL(sUrl); // add to tracked memory list wxluaO_addtrackedobject(L, returns); Index: wxhtml_html.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxhtml_html.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxhtml_html.cpp 7 Dec 2007 06:44:45 -0000 1.6 --- wxhtml_html.cpp 10 Dec 2007 05:39:08 -0000 1.7 *************** *** 39,43 **** static int LUACALL wxLua_wxHtmlCell_AdjustPagebreak(lua_State *L) { - bool returns; // int * pagebreak int pagebreak = (int)wxlua_getintegertype(L, 2); --- 39,42 ---- *************** *** 45,49 **** wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlCell); // call AdjustPagebreak [...2422 lines suppressed...] *** 4922,4926 **** { wxluabind_removetableforcall(L); - wxHtmlHelpController *returns; // get number of arguments int argCount = lua_gettop(L); --- 4804,4807 ---- *************** *** 4928,4932 **** int style = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxHF_DEFAULT_STYLE); // call constructor ! returns = new wxHtmlHelpController(style); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 4809,4813 ---- int style = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxHF_DEFAULT_STYLE); // call constructor ! wxHtmlHelpController* returns = new wxHtmlHelpController(style); // add to tracked memory list wxluaO_addtrackedobject(L, returns); Index: wxcore_clipdrag.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_clipdrag.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxcore_clipdrag.cpp 7 Dec 2007 06:44:43 -0000 1.5 --- wxcore_clipdrag.cpp 10 Dec 2007 05:39:07 -0000 1.6 *************** *** 42,46 **** static int LUACALL wxLua_wxClipboard_AddData(lua_State *L) { - bool returns; // wxDataObject data wxDataObject * data = (wxDataObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDataObject); --- 42,45 ---- *************** *** 49,53 **** wxClipboard * self = (wxClipboard *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxClipboard); // call AddData [...1060 lines suppressed...] *** 2077,2081 **** { wxluabind_removetableforcall(L); - wxMetafileDC *returns; // get number of arguments int argCount = lua_gettop(L); --- 2027,2030 ---- *************** *** 2083,2087 **** const wxString filename = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxEmptyString)); // call constructor ! returns = new wxMetafileDC(filename); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 2032,2036 ---- const wxString filename = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxEmptyString)); // call constructor ! wxMetafileDC* returns = new wxMetafileDC(filename); // add to tracked memory list wxluaO_addtrackedobject(L, returns); Index: wxcore_help.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_help.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxcore_help.cpp 7 Dec 2007 06:44:44 -0000 1.5 --- wxcore_help.cpp 10 Dec 2007 05:39:08 -0000 1.6 *************** *** 41,45 **** static int LUACALL wxLua_wxContextHelp_BeginContextHelp(lua_State *L) { - bool returns; // wxWindow win wxWindow * win = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); --- 41,44 ---- *************** *** 47,51 **** wxContextHelp * self = (wxContextHelp *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxContextHelp); // call BeginContextHelp ! returns = (self->BeginContextHelp(win)); // push the result flag lua_pushboolean(L, returns); --- 46,50 ---- wxContextHelp * self = (wxContextHelp *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxContextHelp); // call BeginContextHelp ! bool returns = (self->BeginContextHelp(win)); // push the result flag lua_pushboolean(L, returns); *************** *** 60,68 **** static int LUACALL wxLua_wxContextHelp_EndContextHelp(lua_State *L) { - bool returns; // get this wxContextHelp * self = (wxContextHelp *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxContextHelp); // call EndContextHelp ! returns = (self->EndContextHelp()); // push the result flag lua_pushboolean(L, returns); --- 59,66 ---- static int LUACALL wxLua_wxContextHelp_EndContextHelp(lua_State *L) { // get this wxContextHelp * self = (wxContextHelp *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxContextHelp); // call EndContextHelp ! bool returns = (self->EndContextHelp()); // push the result flag lua_pushboolean(L, returns); *************** *** 93,97 **** { wxluabind_removetableforcall(L); - wxContextHelp *returns; // get number of arguments int argCount = lua_gettop(L); --- 91,94 ---- *************** *** 101,105 **** wxWindow * win = (argCount >= 1 ? (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow) : NULL); // call constructor ! returns = new wxContextHelp(win, beginHelp); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 98,102 ---- wxWindow * win = (argCount >= 1 ? (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow) : NULL); // call constructor ! wxContextHelp* returns = new wxContextHelp(win, beginHelp); // add to tracked memory list wxluaO_addtrackedobject(L, returns); *************** *** 144,148 **** { wxluabind_removetableforcall(L); - wxContextHelpButton *returns; // get number of arguments int argCount = lua_gettop(L); --- 141,144 ---- *************** *** 158,162 **** wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! returns = new wxContextHelpButton(parent, id, *pos, *size, style); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); --- 154,158 ---- wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! wxContextHelpButton* returns = new wxContextHelpButton(parent, id, *pos, *size, style); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); *************** *** 216,222 **** static int LUACALL wxLua_wxHelpProvider_Get(lua_State *L) { - wxHelpProvider *returns; // call Get ! returns = (wxHelpProvider *)wxHelpProvider::Get(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxHelpProvider, returns); --- 212,217 ---- static int LUACALL wxLua_wxHelpProvider_Get(lua_State *L) { // call Get ! wxHelpProvider* returns = (wxHelpProvider*)wxHelpProvider::Get(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxHelpProvider, returns); *************** *** 231,235 **** static int LUACALL wxLua_wxHelpProvider_GetHelp(lua_State *L) { - wxString returns; // const wxWindow window const wxWindow * window = (const wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); --- 226,229 ---- *************** *** 237,241 **** wxHelpProvider * self = (wxHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpProvider); // call GetHelp ! returns = (self->GetHelp(window)); // push the result string wxlua_pushwxString(L, returns); --- 231,235 ---- wxHelpProvider * self = (wxHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpProvider); // call GetHelp ! wxString returns = (self->GetHelp(window)); // push the result string wxlua_pushwxString(L, returns); *************** *** 266,275 **** static int LUACALL wxLua_wxHelpProvider_Set(lua_State *L) { - wxHelpProvider *returns; // wxHelpProvider helpProvider wxHelpProvider * helpProvider = (wxHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpProvider); if (wxluaO_istrackedobject(L, helpProvider)) wxluaO_removetrackedobject(L, helpProvider, wxLUA_UNDELETE_OBJECT); // call Set ! returns = (wxHelpProvider *)wxHelpProvider::Set(helpProvider); if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxHelpProvider(returns)); // push the result datatype --- 260,268 ---- static int LUACALL wxLua_wxHelpProvider_Set(lua_State *L) { // wxHelpProvider helpProvider wxHelpProvider * helpProvider = (wxHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpProvider); if (wxluaO_istrackedobject(L, helpProvider)) wxluaO_removetrackedobject(L, helpProvider, wxLUA_UNDELETE_OBJECT); // call Set ! wxHelpProvider* returns = (wxHelpProvider*)wxHelpProvider::Set(helpProvider); if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxHelpProvider(returns)); // push the result datatype *************** *** 285,289 **** static int LUACALL wxLua_wxHelpProvider_ShowHelp(lua_State *L) { - bool returns; // wxWindow window wxWindow * window = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); --- 278,281 ---- *************** *** 291,295 **** wxHelpProvider * self = (wxHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpProvider); // call ShowHelp ! returns = (self->ShowHelp(window)); // push the result flag lua_pushboolean(L, returns); --- 283,287 ---- wxHelpProvider * self = (wxHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpProvider); // call ShowHelp ! bool returns = (self->ShowHelp(window)); // push the result flag lua_pushboolean(L, returns); *************** *** 306,310 **** static int LUACALL wxLua_wxHelpProvider_ShowHelpAtPoint(lua_State *L) { - bool returns; // wxHelpEvent::Origin origin wxHelpEvent::Origin origin = (wxHelpEvent::Origin)wxlua_getintegertype(L, 4); --- 298,301 ---- *************** *** 316,320 **** wxHelpProvider * self = (wxHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpProvider); // call ShowHelpAtPoint ! returns = (self->ShowHelpAtPoint(window, *pt, origin)); // push the result flag lua_pushboolean(L, returns); --- 307,311 ---- wxHelpProvider * self = (wxHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpProvider); // call ShowHelpAtPoint ! bool returns = (self->ShowHelpAtPoint(window, *pt, origin)); // push the result flag lua_pushboolean(L, returns); *************** *** 395,403 **** { wxluabind_removetableforcall(L); - wxSimpleHelpProvider *returns; // call constructor ! returns = new wxSimpleHelpProvider(); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxSimpleHelpProvider((wxSimpleHelpProvider *)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxSimpleHelpProvider, returns); --- 386,393 ---- { wxluabind_removetableforcall(L); // call constructor ! wxSimpleHelpProvider* returns = new wxSimpleHelpProvider(); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxSimpleHelpProvider((wxSimpleHelpProvider*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxSimpleHelpProvider, returns); *************** *** 436,444 **** static int LUACALL wxLua_wxHelpControllerHelpProvider_GetHelpController(lua_State *L) { - wxHelpController *returns; // get this wxHelpControllerHelpProvider * self = (wxHelpControllerHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerHelpProvider); // call GetHelpController ! returns = (wxHelpController *)self->GetHelpController(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxHelpController, returns); --- 426,433 ---- static int LUACALL wxLua_wxHelpControllerHelpProvider_GetHelpController(lua_State *L) { // get this wxHelpControllerHelpProvider * self = (wxHelpControllerHelpProvider *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerHelpProvider); // call GetHelpController ! wxHelpController* returns = (wxHelpController*)self->GetHelpController(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxHelpController, returns); *************** *** 485,489 **** { wxluabind_removetableforcall(L); - wxHelpControllerHelpProvider *returns; // get number of arguments int argCount = lua_gettop(L); --- 474,477 ---- *************** *** 491,497 **** wxHelpController * hc = (argCount >= 1 ? (wxHelpController *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpController) : NULL); // call constructor ! returns = new wxHelpControllerHelpProvider(hc); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxHelpControllerHelpProvider((wxHelpControllerHelpProvider *)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxHelpControllerHelpProvider, returns); --- 479,485 ---- wxHelpController * hc = (argCount >= 1 ? (wxHelpController *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpController) : NULL); // call constructor ! wxHelpControllerHelpProvider* returns = new wxHelpControllerHelpProvider(hc); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxHelpControllerHelpProvider((wxHelpControllerHelpProvider*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxHelpControllerHelpProvider, returns); *************** *** 532,536 **** static int LUACALL wxLua_wxHelpControllerBase_DisplayBlock(lua_State *L) { - bool returns; // long blockNo long blockNo = (long)wxlua_getnumbertype(L, 2); --- 520,523 ---- *************** *** 538,542 **** wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplayBlock ! returns = (self->DisplayBlock(blockNo)); // push the result flag lua_pushboolean(L, returns); --- 525,529 ---- wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplayBlock ! bool returns = (self->DisplayBlock(blockNo)); // push the result flag lua_pushboolean(L, returns); *************** *** 551,559 **** static int LUACALL wxLua_wxHelpControllerBase_DisplayContents(lua_State *L) { - bool returns; // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplayContents ! returns = (self->DisplayContents()); // push the result flag lua_pushboolean(L, returns); --- 538,545 ---- static int LUACALL wxLua_wxHelpControllerBase_DisplayContents(lua_State *L) { // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplayContents ! bool returns = (self->DisplayContents()); // push the result flag lua_pushboolean(L, returns); *************** *** 568,572 **** static int LUACALL wxLua_wxHelpControllerBase_DisplayContextPopup(lua_State *L) { - bool returns; // int contextId int contextId = (int)wxlua_getnumbertype(L, 2); --- 554,557 ---- *************** *** 574,578 **** wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplayContextPopup ! returns = (self->DisplayContextPopup(contextId)); // push the result flag lua_pushboolean(L, returns); --- 559,563 ---- wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplayContextPopup ! bool returns = (self->DisplayContextPopup(contextId)); // push the result flag lua_pushboolean(L, returns); *************** *** 587,591 **** static int LUACALL wxLua_wxHelpControllerBase_DisplaySection1(lua_State *L) { - bool returns; // const wxString section const wxString section = wxlua_getwxStringtype(L, 2); --- 572,575 ---- *************** *** 593,597 **** wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplaySection ! returns = (self->DisplaySection(section)); // push the result flag lua_pushboolean(L, returns); --- 577,581 ---- wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplaySection ! bool returns = (self->DisplaySection(section)); // push the result flag lua_pushboolean(L, returns); *************** *** 606,610 **** static int LUACALL wxLua_wxHelpControllerBase_DisplaySection(lua_State *L) { - bool returns; // int sectionNo int sectionNo = (int)wxlua_getnumbertype(L, 2); --- 590,593 ---- *************** *** 612,616 **** wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplaySection ! returns = (self->DisplaySection(sectionNo)); // push the result flag lua_pushboolean(L, returns); --- 595,599 ---- wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplaySection ! bool returns = (self->DisplaySection(sectionNo)); // push the result flag lua_pushboolean(L, returns); *************** *** 627,631 **** static int LUACALL wxLua_wxHelpControllerBase_DisplayTextPopup(lua_State *L) { - bool returns; // const wxPoint pos const wxPoint * pos = (const wxPoint *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxPoint); --- 610,613 ---- *************** *** 635,639 **** wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplayTextPopup ! returns = (self->DisplayTextPopup(text, *pos)); // push the result flag lua_pushboolean(L, returns); --- 617,621 ---- wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call DisplayTextPopup ! bool returns = (self->DisplayTextPopup(text, *pos)); // push the result flag lua_pushboolean(L, returns); *************** *** 652,657 **** static int LUACALL wxLua_wxHelpControllerBase_GetFrameParameters(lua_State *L) { - wxFrame *returns; - bool newFrameEachTime = false; wxPoint *pos = new wxPoint(); --- 634,637 ---- *************** *** 660,664 **** wxHelpControllerBase *self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call GetFrameParameters ! returns = self->GetFrameParameters(size, pos, &newFrameEachTime); // push the result datatype --- 640,644 ---- wxHelpControllerBase *self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call GetFrameParameters ! wxFrame *returns = self->GetFrameParameters(size, pos, &newFrameEachTime); // push the result datatype *************** *** 681,689 **** static int LUACALL wxLua_wxHelpControllerBase_GetParentWindow(lua_State *L) { - wxWindow *returns; // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call GetParentWindow ! returns = (wxWindow *)self->GetParentWindow(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxWindow, returns); --- 661,668 ---- static int LUACALL wxLua_wxHelpControllerBase_GetParentWindow(lua_State *L) { // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call GetParentWindow ! wxWindow* returns = (wxWindow*)self->GetParentWindow(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxWindow, returns); *************** *** 716,720 **** static int LUACALL wxLua_wxHelpControllerBase_KeywordSearch(lua_State *L) { - bool returns; // get number of arguments int argCount = lua_gettop(L); --- 695,698 ---- *************** *** 726,730 **** wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call KeywordSearch ! returns = (self->KeywordSearch(keyWord, mode)); // push the result flag lua_pushboolean(L, returns); --- 704,708 ---- wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call KeywordSearch ! bool returns = (self->KeywordSearch(keyWord, mode)); // push the result flag lua_pushboolean(L, returns); *************** *** 739,743 **** static int LUACALL wxLua_wxHelpControllerBase_LoadFile(lua_State *L) { - bool returns; // get number of arguments int argCount = lua_gettop(L); --- 717,720 ---- *************** *** 747,751 **** wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call LoadFile ! returns = (self->LoadFile(file)); // push the result flag lua_pushboolean(L, returns); --- 724,728 ---- wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call LoadFile ! bool returns = (self->LoadFile(file)); // push the result flag lua_pushboolean(L, returns); *************** *** 760,768 **** static int LUACALL wxLua_wxHelpControllerBase_Quit(lua_State *L) { - bool returns; // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call Quit ! returns = (self->Quit()); // push the result flag lua_pushboolean(L, returns); --- 737,744 ---- static int LUACALL wxLua_wxHelpControllerBase_Quit(lua_State *L) { // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); // call Quit ! bool returns = (self->Quit()); // push the result flag lua_pushboolean(L, returns); *************** *** 948,954 **** { wxluabind_removetableforcall(L); - wxHelpController *returns; // call constructor ! returns = new wxHelpController(); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 924,929 ---- { wxluabind_removetableforcall(L); // call constructor ! wxHelpController* returns = new wxHelpController(); // add to tracked memory list wxluaO_addtrackedobject(L, returns); *************** *** 1004,1010 **** { wxluabind_removetableforcall(L); - wxWinHelpController *returns; // call constructor ! returns = new wxWinHelpController(); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 979,984 ---- { wxluabind_removetableforcall(L); // call constructor ! wxWinHelpController* returns = new wxWinHelpController(); // add to tracked memory list wxluaO_addtrackedobject(L, returns); *************** *** 1061,1065 **** { wxluabind_removetableforcall(L); - wxBestHelpController *returns; // get number of arguments int argCount = lua_gettop(L); --- 1035,1038 ---- *************** *** 1069,1073 **** wxWindow * parentWindow = (argCount >= 1 ? (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow) : NULL); // call constructor ! returns = new wxBestHelpController(parentWindow, style); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 1042,1046 ---- wxWindow * parentWindow = (argCount >= 1 ? (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow) : NULL); // call constructor ! wxBestHelpController* returns = new wxBestHelpController(parentWindow, style); // add to tracked memory list wxluaO_addtrackedobject(L, returns); *************** *** 1123,1129 **** { wxluabind_removetableforcall(L); - wxExtHelpController *returns; // call constructor ! returns = new wxExtHelpController(); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 1096,1101 ---- { wxluabind_removetableforcall(L); // call constructor ! wxExtHelpController* returns = new wxExtHelpController(); // add to tracked memory list wxluaO_addtrackedobject(L, returns); Index: wxadv_adv.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxadv_adv.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxadv_adv.cpp 7 Dec 2007 06:44:42 -0000 1.5 --- wxadv_adv.cpp 10 Dec 2007 05:39:06 -0000 1.6 *************** *** 101,112 **** static int LUACALL wxLua_wxAboutDialogInfo_GetArtists(lua_State *L) { - wxArrayString *returns; // get this wxAboutDialogInfo * self = (wxAboutDialogInfo *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxAboutDialogInfo); // call GetArtists // allocate a new object using the copy constructor ! returns = new wxArrayString(self->GetArtists()); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxArrayString((wxArrayString *)returns)); [...4498 lines suppressed...] // call constructor ! wxWave* returns = new wxWave(fileName, isResource); // add to tracked memory list wxluaO_addtrackedobject(L, returns); *************** *** 7337,7343 **** { wxluabind_removetableforcall(L); - wxWave *returns; // call constructor ! returns = new wxWave(); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 7159,7164 ---- { wxluabind_removetableforcall(L); // call constructor ! wxWave* returns = new wxWave(); // add to tracked memory list wxluaO_addtrackedobject(L, returns); Index: wxaui_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxaui_bind.cpp 25 Nov 2007 21:34:05 -0000 1.3 --- wxaui_bind.cpp 10 Dec 2007 05:39:06 -0000 1.4 *************** *** 263,280 **** } - // --------------------------------------------------------------------------- // wxLuaBinding_wxaui() - the binding class // --------------------------------------------------------------------------- - // binding class - extern wxLuaBindClass *wxLuaGetClassList_wxaui(size_t &count); - extern wxLuaBindDefine *wxLuaGetDefineList_wxaui(size_t &count); - extern wxLuaBindString *wxLuaGetStringList_wxaui(size_t &count); - extern wxLuaBindEvent *wxLuaGetEventList_wxaui(size_t &count); - extern wxLuaBindObject *wxLuaGetObjectList_wxaui(size_t &count); - extern wxLuaBindMethod *wxLuaGetFunctionList_wxaui(size_t &count); - - IMPLEMENT_DYNAMIC_CLASS(wxLuaBinding_wxaui, wxLuaBinding) --- 263,270 ---- *************** *** 299,304 **** } - // bind wxLuaBinding_wxaui to a single wxLuaState bool wxLuaBinding_wxaui_bind(const wxLuaState& wxlState_) { --- 289,294 ---- } + // --------------------------------------------------------------------------- bool wxLuaBinding_wxaui_bind(const wxLuaState& wxlState_) { *************** *** 317,321 **** return true; } ! // initialize wxLuaBinding_wxaui for all wxLuaStates bool wxLuaBinding_wxaui_init() { --- 307,311 ---- return true; } ! bool wxLuaBinding_wxaui_init() { Index: wxcore_gdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_gdi.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxcore_gdi.cpp 7 Dec 2007 06:44:44 -0000 1.7 --- wxcore_gdi.cpp 10 Dec 2007 05:39:08 -0000 1.8 *************** *** 151,155 **** static int LUACALL wxLua_wxPoint_op_add1(lua_State *L) { - wxPoint *returns; // const wxSize s const wxSize * s = (const wxSize *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxSize); --- 151,154 ---- *************** *** 158,164 **** // call op_add // allocate a new object using the copy constructor [...8208 lines suppressed...] static int LUACALL wxLua_wxRendererNative_Set(lua_State *L) { - wxRendererNative *returns; // wxRendererNative renderer wxRendererNative * renderer = (wxRendererNative *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxRendererNative); if (wxluaO_istrackedobject(L, renderer)) wxluaO_removetrackedobject(L, renderer, wxLUA_UNDELETE_OBJECT); // call Set ! returns = (wxRendererNative *)wxRendererNative::Set(renderer); if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxRendererNative(returns)); // push the result datatype --- 15170,15178 ---- static int LUACALL wxLua_wxRendererNative_Set(lua_State *L) { // wxRendererNative renderer wxRendererNative * renderer = (wxRendererNative *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxRendererNative); if (wxluaO_istrackedobject(L, renderer)) wxluaO_removetrackedobject(L, renderer, wxLUA_UNDELETE_OBJECT); // call Set ! wxRendererNative* returns = (wxRendererNative*)wxRendererNative::Set(renderer); if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxRendererNative(returns)); // push the result datatype Index: wxbase_data.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxbase_data.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wxbase_data.cpp 7 Dec 2007 06:44:43 -0000 1.8 --- wxbase_data.cpp 10 Dec 2007 05:39:07 -0000 1.9 *************** *** 39,47 **** static int LUACALL wxLua_wxString_GetData(lua_State *L) { - wxString returns; // get this wxString * self = (wxString *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxString); // call GetData ! returns = (self->GetData()); // push the result string wxlua_pushwxString(L, returns); --- 39,46 ---- [...1772 lines suppressed...] // get number of arguments int argCount = lua_gettop(L); --- 2802,2805 ---- *************** *** 2896,2902 **** unsigned long hi = (argCount >= 1 ? (long)wxlua_getnumbertype(L, 1) : 0); // call constructor ! returns = new wxULongLong(hi, lo); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxULongLong((wxULongLong *)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxULongLong, returns); --- 2809,2815 ---- unsigned long hi = (argCount >= 1 ? (long)wxlua_getnumbertype(L, 1) : 0); // call constructor ! wxULongLong* returns = new wxULongLong(hi, lo); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxULongLong((wxULongLong*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxULongLong, returns); Index: wxgl_gl.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxgl_gl.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxgl_gl.cpp 7 Dec 2007 06:44:45 -0000 1.3 --- wxgl_gl.cpp 10 Dec 2007 05:39:08 -0000 1.4 *************** *** 35,43 **** static int LUACALL wxLua_wxGLCanvas_GetContext(lua_State *L) { - wxGLContext *returns; // get this wxGLCanvas * self = (wxGLCanvas *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGLCanvas); // call GetContext ! returns = (wxGLContext *)self->GetContext(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxGLContext, returns); --- 35,42 ---- static int LUACALL wxLua_wxGLCanvas_GetContext(lua_State *L) { // get this wxGLCanvas * self = (wxGLCanvas *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGLCanvas); // call GetContext ! wxGLContext* returns = (wxGLContext*)self->GetContext(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxGLContext, returns); *************** *** 119,123 **** { wxluabind_removetableforcall(L); - wxGLCanvas *returns; // get number of arguments int argCount = lua_gettop(L); --- 118,121 ---- *************** *** 139,143 **** wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! returns = new wxGLCanvas(parent, id, attribList, *pos, *size, style, name, *palette); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); --- 137,141 ---- wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! wxGLCanvas* returns = new wxGLCanvas(parent, id, attribList, *pos, *size, style, name, *palette); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); *************** *** 155,159 **** { wxluabind_removetableforcall(L); - wxGLCanvas *returns; // get number of arguments int argCount = lua_gettop(L); --- 153,156 ---- *************** *** 177,181 **** wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! returns = new wxGLCanvas(parent, sharedCanvas, id, *pos, *size, style, name, attribList, *palette); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); --- 174,178 ---- wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! wxGLCanvas* returns = new wxGLCanvas(parent, sharedCanvas, id, *pos, *size, style, name, attribList, *palette); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); *************** *** 193,197 **** { wxluabind_removetableforcall(L); - wxGLCanvas *returns; // get number of arguments int argCount = lua_gettop(L); --- 190,193 ---- *************** *** 215,219 **** wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! returns = new wxGLCanvas(parent, sharedContext, id, *pos, *size, style, name, attribList, *palette); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); --- 211,215 ---- wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! wxGLCanvas* returns = new wxGLCanvas(parent, sharedContext, id, *pos, *size, style, name, attribList, *palette); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); *************** *** 231,235 **** { wxluabind_removetableforcall(L); - wxGLCanvas *returns; // get number of arguments int argCount = lua_gettop(L); --- 227,230 ---- *************** *** 251,255 **** wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! returns = new wxGLCanvas(parent, id, *pos, *size, style, name, attribList, *palette); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); --- 246,250 ---- wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! wxGLCanvas* returns = new wxGLCanvas(parent, id, *pos, *size, style, name, attribList, *palette); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); *************** *** 357,365 **** static int LUACALL wxLua_wxGLContext_GetWindow(lua_State *L) { - const wxWindow *returns; // get this wxGLContext * self = (wxGLContext *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGLContext); // call GetWindow ! returns = (const wxWindow *)self->GetWindow(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxWindow, returns); --- 352,359 ---- static int LUACALL wxLua_wxGLContext_GetWindow(lua_State *L) { // get this wxGLContext * self = (wxGLContext *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGLContext); // call GetWindow ! const wxWindow* returns = (const wxWindow*)self->GetWindow(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxWindow, returns); *************** *** 444,448 **** { wxluabind_removetableforcall(L); - wxGLContext *returns; // get number of arguments int argCount = lua_gettop(L); --- 438,441 ---- *************** *** 456,460 **** bool isRGB = wxlua_getbooleantype(L, 1); // call constructor ! returns = new wxGLContext(isRGB, win, *palette, other); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); --- 449,453 ---- bool isRGB = wxlua_getbooleantype(L, 1); // call constructor ! wxGLContext* returns = new wxGLContext(isRGB, win, *palette, other); // add to tracked window list, it will check validity wxluaW_addtrackedwindow(L, returns); *************** *** 472,476 **** { wxluabind_removetableforcall(L); - wxGLContext *returns; // get number of arguments int argCount = lua_gettop(L); --- 465,468 -... [truncated message content] |
From: John L. <jr...@us...> - 2007-12-10 05:39:21
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23281/wxLua/modules/wxluasocket/src Modified Files: wxlsock.cpp wxluasocket.cpp wxluasocket_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: wxluasocket_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket_bind.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wxluasocket_bind.cpp 17 Nov 2007 00:15:12 -0000 1.23 --- wxluasocket_bind.cpp 10 Dec 2007 05:39:10 -0000 1.24 *************** *** 145,162 **** } - // --------------------------------------------------------------------------- // wxLuaBinding_wxluasocket() - the binding class // --------------------------------------------------------------------------- - // binding class - extern wxLuaBindClass *wxLuaGetClassList_wxluasocket(size_t &count); - extern wxLuaBindDefine *wxLuaGetDefineList_wxluasocket(size_t &count); - extern wxLuaBindString *wxLuaGetStringList_wxluasocket(size_t &count); - extern wxLuaBindEvent *wxLuaGetEventList_wxluasocket(size_t &count); - extern wxLuaBindObject *wxLuaGetObjectList_wxluasocket(size_t &count); - extern wxLuaBindMethod *wxLuaGetFunctionList_wxluasocket(size_t &count); - - IMPLEMENT_DYNAMIC_CLASS(wxLuaBinding_wxluasocket, wxLuaBinding) --- 145,152 ---- *************** *** 181,186 **** } - // bind wxLuaBinding_wxluasocket to a single wxLuaState bool wxLuaBinding_wxluasocket_bind(const wxLuaState& wxlState_) { --- 171,176 ---- } + // --------------------------------------------------------------------------- bool wxLuaBinding_wxluasocket_bind(const wxLuaState& wxlState_) { *************** *** 199,203 **** return true; } ! // initialize wxLuaBinding_wxluasocket for all wxLuaStates bool wxLuaBinding_wxluasocket_init() { --- 189,193 ---- return true; } ! bool wxLuaBinding_wxluasocket_init() { Index: wxluasocket.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wxluasocket.cpp 7 Dec 2007 06:44:47 -0000 1.33 --- wxluasocket.cpp 10 Dec 2007 05:39:10 -0000 1.34 *************** *** 33,37 **** static int LUACALL wxLua_wxLuaDebuggerServer_AddBreakPoint(lua_State *L) { - bool returns; // int lineNumber int lineNumber = (int)wxlua_getnumbertype(L, 3); --- 33,36 ---- *************** *** 41,45 **** wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call AddBreakPoint ! returns = (self->AddBreakPoint(fileName, lineNumber)); // push the result flag lua_pushboolean(L, returns); --- 40,44 ---- wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call AddBreakPoint ! bool returns = (self->AddBreakPoint(fileName, lineNumber)); // push the result flag lua_pushboolean(L, returns); *************** *** 54,62 **** static int LUACALL wxLua_wxLuaDebuggerServer_Break(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Break ! returns = (self->Break()); // push the result flag lua_pushboolean(L, returns); --- 53,60 ---- static int LUACALL wxLua_wxLuaDebuggerServer_Break(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Break ! bool returns = (self->Break()); // push the result flag lua_pushboolean(L, returns); *************** *** 71,79 **** static int LUACALL wxLua_wxLuaDebuggerServer_ClearAllBreakPoints(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call ClearAllBreakPoints ! returns = (self->ClearAllBreakPoints()); // push the result flag lua_pushboolean(L, returns); --- 69,76 ---- static int LUACALL wxLua_wxLuaDebuggerServer_ClearAllBreakPoints(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call ClearAllBreakPoints ! bool returns = (self->ClearAllBreakPoints()); // push the result flag lua_pushboolean(L, returns); *************** *** 88,96 **** static int LUACALL wxLua_wxLuaDebuggerServer_Continue(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Continue ! returns = (self->Continue()); // push the result flag lua_pushboolean(L, returns); --- 85,92 ---- static int LUACALL wxLua_wxLuaDebuggerServer_Continue(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Continue ! bool returns = (self->Continue()); // push the result flag lua_pushboolean(L, returns); *************** *** 125,129 **** static int LUACALL wxLua_wxLuaDebuggerServer_EvaluateExpr(lua_State *L) { - bool returns; // const wxString expr const wxString expr = wxlua_getwxStringtype(L, 3); --- 121,124 ---- *************** *** 133,137 **** wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call EvaluateExpr ! returns = (self->EvaluateExpr(exprRef, expr)); // push the result flag lua_pushboolean(L, returns); --- 128,132 ---- wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call EvaluateExpr ! bool returns = (self->EvaluateExpr(exprRef, expr)); // push the result flag lua_pushboolean(L, returns); *************** *** 146,154 **** static int LUACALL wxLua_wxLuaDebuggerServer_GetDebuggeeProcessId(lua_State *L) { - long returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call GetDebuggeeProcessId ! returns = (self->GetDebuggeeProcessId()); // push the result number lua_pushnumber(L, returns); --- 141,148 ---- static int LUACALL wxLua_wxLuaDebuggerServer_GetDebuggeeProcessId(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call GetDebuggeeProcessId ! long returns = (self->GetDebuggeeProcessId()); // push the result number lua_pushnumber(L, returns); *************** *** 162,168 **** static int LUACALL wxLua_wxLuaDebuggerServer_GetNetworkName(lua_State *L) { - wxString returns; // call GetNetworkName ! returns = (wxLuaDebuggerServer::GetNetworkName()); // push the result string wxlua_pushwxString(L, returns); --- 156,161 ---- static int LUACALL wxLua_wxLuaDebuggerServer_GetNetworkName(lua_State *L) { // call GetNetworkName ! wxString returns = (wxLuaDebuggerServer::GetNetworkName()); // push the result string wxlua_pushwxString(L, returns); *************** *** 176,182 **** static int LUACALL wxLua_wxLuaDebuggerServer_GetProgramName(lua_State *L) { - wxString returns; // call GetProgramName ! returns = (wxLuaDebuggerServer::GetProgramName()); // push the result string wxlua_pushwxString(L, returns); --- 169,174 ---- static int LUACALL wxLua_wxLuaDebuggerServer_GetProgramName(lua_State *L) { // call GetProgramName ! wxString returns = (wxLuaDebuggerServer::GetProgramName()); // push the result string wxlua_pushwxString(L, returns); *************** *** 191,199 **** static int LUACALL wxLua_wxLuaDebuggerServer_KillDebuggee(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call KillDebuggee ! returns = (self->KillDebuggee()); // push the result flag lua_pushboolean(L, returns); --- 183,190 ---- static int LUACALL wxLua_wxLuaDebuggerServer_KillDebuggee(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call KillDebuggee ! bool returns = (self->KillDebuggee()); // push the result flag lua_pushboolean(L, returns); *************** *** 208,212 **** static int LUACALL wxLua_wxLuaDebuggerServer_RemoveBreakPoint(lua_State *L) { - bool returns; // int lineNumber int lineNumber = (int)wxlua_getnumbertype(L, 3); --- 199,202 ---- *************** *** 216,220 **** wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call RemoveBreakPoint ! returns = (self->RemoveBreakPoint(fileName, lineNumber)); // push the result flag lua_pushboolean(L, returns); --- 206,210 ---- wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call RemoveBreakPoint ! bool returns = (self->RemoveBreakPoint(fileName, lineNumber)); // push the result flag lua_pushboolean(L, returns); *************** *** 229,237 **** static int LUACALL wxLua_wxLuaDebuggerServer_Reset(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Reset ! returns = (self->Reset()); // push the result flag lua_pushboolean(L, returns); --- 219,226 ---- static int LUACALL wxLua_wxLuaDebuggerServer_Reset(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Reset ! bool returns = (self->Reset()); // push the result flag lua_pushboolean(L, returns); *************** *** 246,250 **** static int LUACALL wxLua_wxLuaDebuggerServer_Run(lua_State *L) { - bool returns; // const wxString fileName const wxString fileName = wxlua_getwxStringtype(L, 3); --- 235,238 ---- *************** *** 254,258 **** wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Run ! returns = (self->Run(file, fileName)); // push the result flag lua_pushboolean(L, returns); --- 242,246 ---- wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Run ! bool returns = (self->Run(file, fileName)); // push the result flag lua_pushboolean(L, returns); *************** *** 267,275 **** static int LUACALL wxLua_wxLuaDebuggerServer_StartClient(lua_State *L) { - long returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StartClient ! returns = (self->StartClient()); // push the result number lua_pushnumber(L, returns); --- 255,262 ---- static int LUACALL wxLua_wxLuaDebuggerServer_StartClient(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StartClient ! long returns = (self->StartClient()); // push the result number lua_pushnumber(L, returns); *************** *** 284,292 **** static int LUACALL wxLua_wxLuaDebuggerServer_StartServer(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StartServer ! returns = (self->StartServer()); // push the result flag lua_pushboolean(L, returns); --- 271,278 ---- static int LUACALL wxLua_wxLuaDebuggerServer_StartServer(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StartServer ! bool returns = (self->StartServer()); // push the result flag lua_pushboolean(L, returns); *************** *** 301,309 **** static int LUACALL wxLua_wxLuaDebuggerServer_Step(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Step ! returns = (self->Step()); // push the result flag lua_pushboolean(L, returns); --- 287,294 ---- static int LUACALL wxLua_wxLuaDebuggerServer_Step(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call Step ! bool returns = (self->Step()); // push the result flag lua_pushboolean(L, returns); *************** *** 318,326 **** static int LUACALL wxLua_wxLuaDebuggerServer_StepOut(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StepOut ! returns = (self->StepOut()); // push the result flag lua_pushboolean(L, returns); --- 303,310 ---- static int LUACALL wxLua_wxLuaDebuggerServer_StepOut(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StepOut ! bool returns = (self->StepOut()); // push the result flag lua_pushboolean(L, returns); *************** *** 335,343 **** static int LUACALL wxLua_wxLuaDebuggerServer_StepOver(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StepOver ! returns = (self->StepOver()); // push the result flag lua_pushboolean(L, returns); --- 319,326 ---- static int LUACALL wxLua_wxLuaDebuggerServer_StepOver(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StepOver ! bool returns = (self->StepOver()); // push the result flag lua_pushboolean(L, returns); *************** *** 352,360 **** static int LUACALL wxLua_wxLuaDebuggerServer_StopServer(lua_State *L) { - bool returns; // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StopServer ! returns = (self->StopServer()); // push the result flag lua_pushboolean(L, returns); --- 335,342 ---- static int LUACALL wxLua_wxLuaDebuggerServer_StopServer(lua_State *L) { // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); // call StopServer ! bool returns = (self->StopServer()); // push the result flag lua_pushboolean(L, returns); *************** *** 385,393 **** { wxluabind_removetableforcall(L); - wxLuaDebuggerServer *returns; // int portNumber int portNumber = (int)wxlua_getnumbertype(L, 1); // call constructor ! returns = new wxLuaDebuggerServer(portNumber); // add to tracked memory list wxluaO_addtrackedobject(L, returns); --- 367,374 ---- { wxluabind_removetableforcall(L); // int portNumber int portNumber = (int)wxlua_getnumbertype(L, 1); // call constructor ! wxLuaDebuggerServer* returns = new wxLuaDebuggerServer(portNumber); // add to tracked memory list wxluaO_addtrackedobject(L, returns); *************** *** 442,450 **** static int LUACALL wxLua_wxLuaDebuggerEvent_GetFileName(lua_State *L) { - wxString returns; // get this wxLuaDebuggerEvent * self = (wxLuaDebuggerEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerEvent); // call GetFileName ! returns = (self->GetFileName()); // push the result string wxlua_pushwxString(L, returns); --- 423,430 ---- static int LUACALL wxLua_wxLuaDebuggerEvent_GetFileName(lua_State *L) { // get this wxLuaDebuggerEvent * self = (wxLuaDebuggerEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerEvent); // call GetFileName ! wxString returns = (self->GetFileName()); // push the result string wxlua_pushwxString(L, returns); *************** *** 459,467 **** static int LUACALL wxLua_wxLuaDebuggerEvent_GetLineNumber(lua_State *L) { - int returns; // get this wxLuaDebuggerEvent * self = (wxLuaDebuggerEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerEvent); // call GetLineNumber ! returns = (self->GetLineNumber()); // push the result number lua_pushnumber(L, returns); --- 439,446 ---- static int LUACALL wxLua_wxLuaDebuggerEvent_GetLineNumber(lua_State *L) { // get this wxLuaDebuggerEvent * self = (wxLuaDebuggerEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerEvent); // call GetLineNumber ! int returns = (self->GetLineNumber()); // push the result number lua_pushnumber(L, returns); *************** *** 476,484 **** static int LUACALL wxLua_wxLuaDebuggerEvent_GetMessage(lua_State *L) { - wxString returns; // get this wxLuaDebuggerEvent * self = (wxLuaDebuggerEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerEvent); // call GetMessage ! returns = (self->GetMessage()); // push the result string wxlua_pushwxString(L, returns); --- 455,462 ---- static int LUACALL wxLua_wxLuaDebuggerEvent_GetMessage(lua_State *L) { // get this wxLuaDebuggerEvent * self = (wxLuaDebuggerEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerEvent); // call GetMessage ! wxString returns = (self->GetMessage()); // push the result string wxlua_pushwxString(L, returns); *************** *** 493,501 **** static int LUACALL wxLua_wxLuaDebuggerEvent_GetReference(lua_State *L) { - int returns; // get this wxLuaDebuggerEvent * self = (wxLuaDebuggerEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerEvent); // call GetReference ! returns = (self->GetReference()); // push the result number lua_pushnumber(L, returns); --- 471,478 ---- static int LUACALL wxLua_wxLuaDebuggerEvent_GetReference(lua_State *L) { // get this wxLuaDebuggerEvent * self = (wxLuaDebuggerEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerEvent); // call GetReference ! int returns = (self->GetReference()); // push the result number lua_pushnumber(L, returns); Index: wxlsock.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxlsock.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wxlsock.cpp 8 Nov 2007 23:47:15 -0000 1.32 --- wxlsock.cpp 10 Dec 2007 05:39:10 -0000 1.33 *************** *** 154,161 **** { wxLuaDebugData debugData(true); - bool ok = false; wxInt32 idx, idxMax = 0; ! ok = ReadInt32(idxMax); wxLuaSocketDebugMsg(m_name + wxT(" wxLuaSocketBase::ReadDebugData"), wxString::Format(wxT("items %d"), idxMax)); --- 154,160 ---- { wxLuaDebugData debugData(true); wxInt32 idx, idxMax = 0; ! bool ok = ReadInt32(idxMax); wxLuaSocketDebugMsg(m_name + wxT(" wxLuaSocketBase::ReadDebugData"), wxString::Format(wxT("items %d"), idxMax)); *************** *** 249,258 **** // {char GetName \0}{char GetType \0}{char GetValue \0}{char GetSource \0}] - bool ok = false; wxInt32 idx, idxMax = debugData.GetCount(); wxLuaSocketDebugMsg(m_name + wxT(" wxLuaSocketBase::WriteDebugData"), wxString::Format(wxT("items %d"), idxMax)); ! ok = Write((const char*)&idxMax, sizeof(wxInt32)) == sizeof(wxInt32); for (idx = 0; ok && (idx < idxMax); ++idx) --- 248,256 ---- // {char GetName \0}{char GetType \0}{char GetValue \0}{char GetSource \0}] wxInt32 idx, idxMax = debugData.GetCount(); wxLuaSocketDebugMsg(m_name + wxT(" wxLuaSocketBase::WriteDebugData"), wxString::Format(wxT("items %d"), idxMax)); ! bool ok = Write((const char*)&idxMax, sizeof(wxInt32)) == sizeof(wxInt32); for (idx = 0; ok && (idx < idxMax); ++idx) |
From: John L. <jr...@us...> - 2007-12-10 05:39:21
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23281/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxlstate.h wxlua_bind.h 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: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** wxlbind.h 7 Dec 2007 02:13:14 -0000 1.69 --- wxlbind.h 10 Dec 2007 05:39:09 -0000 1.70 *************** *** 87,90 **** --- 87,93 ---- extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxWindow; // The Lua tag for wxWindows extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxString; // The Lua tag for wxStrings + extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxArrayString; // The Lua tag for wxArrayString + extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxSortedArrayString; // The Lua tag for wxSortedArrayString + extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxArrayInt; // The Lua tag for wxArrayInt // ---------------------------------------------------------------------------- Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** wxlstate.h 8 Dec 2007 00:25:22 -0000 1.103 --- wxlstate.h 10 Dec 2007 05:39:09 -0000 1.104 *************** *** 132,135 **** --- 132,140 ---- // lightuserdata value for the wxLuaState. extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluadebughookdata_key; + // The key in the LUA_REGISTRYINDEX table that is a weak keyed table of + // LUA_REGISTRYINDEX[wxlua_lreg_XXX_key table] = {&wxlua_lreg_XXX_key} + // This is used by the wxLuaDebugData to know if the table is one of the wxLua + // Reg tables for better wxLuaStackDialog performance. + extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_regtable_key; // Light user data used as keys in the metatables created for the class userdata objects. *************** *** 143,146 **** --- 148,156 ---- // ---------------------------------------------------------------------------- + // Create one of the wxlua_lreg_XXX_key tables in the LUA_REGISTRYINDEX and + // properly set the wxlua_lreg_regtablekey_key key too. + WXDLLIMPEXP_WXLUA void wxlua_lreg_createtable(lua_State* L, void* lightuserdata_reg_key); + + // ---------------------------------------------------------------------------- // Lua C helper functions - These functions are also part of the wxLuaState // and you are recommended to use those if the wxLuaState is required. However *************** *** 263,266 **** --- 273,278 ---- // LUA_REGISTRYINDEX. WXDLLIMPEXP_WXLUA bool LUACALL wxluaO_istrackedobject(lua_State *L, void *obj_ptr); + // Get a wxArrayString of the info in the wxlua_lreg_delobjects_key LUA_REGISTRYINDEX table. + WXDLLIMPEXP_WXLUA wxArrayString LUACALL wxluaO_gettrackedobjectstrings(lua_State *L); // If an object was pushed into Lua using wxluaT_pushusertag with track=true *************** *** 284,287 **** --- 296,301 ---- // wxlua_lreg_topwindows_key table of the LUA_REGISTRYINDEX table WXDLLIMPEXP_WXLUA bool LUACALL wxluaW_istrackedwindow(lua_State *L, wxWindow* win, bool check_parents); + // Get a wxArrayString of the info in the wxlua_lreg_topwindows_key LUA_REGISTRYINDEX table. + WXDLLIMPEXP_WXLUA wxArrayString LUACALL wxluaW_gettrackedwindowstrings(lua_State *L); // ---------------------------------------------------------------------------- *************** *** 620,626 **** wxWindowID GetId() const; ! // Sends a wxLuaEvent, after checking that this is valid, to the set ! // wxEventHandler with the set id (see SetEventHandler) which may be NULL. ! void SendEvent( wxLuaEvent &event ) const; // ----------------------------------------------------------------------- --- 634,641 ---- wxWindowID GetId() const; ! // Sends the input wxLuaEvent, after checking that this is valid, to the ! // set wxEventHandler (may be NULL), see constructor or SetEventHandler(). ! // returns wxEvtHandler::ProcessEvent(event) ! bool SendEvent( wxLuaEvent &event ) const; // ----------------------------------------------------------------------- Index: wxlua_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlua_bind.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxlua_bind.h 7 Dec 2007 02:13:14 -0000 1.7 --- wxlua_bind.h 10 Dec 2007 05:39:10 -0000 1.8 *************** *** 50,53 **** --- 50,64 ---- // --------------------------------------------------------------------------- + // Functions to access wxLuaBindXXX structs + // --------------------------------------------------------------------------- + + extern wxLuaBindClass *wxLuaGetClassList_wxlua(size_t &count); + extern wxLuaBindDefine *wxLuaGetDefineList_wxlua(size_t &count); + extern wxLuaBindString *wxLuaGetStringList_wxlua(size_t &count); + extern wxLuaBindEvent *wxLuaGetEventList_wxlua(size_t &count); + extern wxLuaBindObject *wxLuaGetObjectList_wxlua(size_t &count); + extern wxLuaBindMethod *wxLuaGetFunctionList_wxlua(size_t &count); + + // --------------------------------------------------------------------------- // Lua Tag Method Values and Tables for each Class // --------------------------------------------------------------------------- *************** *** 61,65 **** - // --------------------------------------------------------------------------- // Encapsulation Declarations - need to be public for other bindings. --- 72,75 ---- |
From: John L. <jr...@us...> - 2007-12-10 05:39:21
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23281/wxLua/modules/wxluasocket/include Modified Files: wxluasocket_bind.h 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: wxluasocket_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxluasocket_bind.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** wxluasocket_bind.h 7 Dec 2007 02:13:14 -0000 1.28 --- wxluasocket_bind.h 10 Dec 2007 05:39:10 -0000 1.29 *************** *** 58,61 **** --- 58,72 ---- // --------------------------------------------------------------------------- + // Functions to access wxLuaBindXXX structs + // --------------------------------------------------------------------------- + + extern wxLuaBindClass *wxLuaGetClassList_wxluasocket(size_t &count); + extern wxLuaBindDefine *wxLuaGetDefineList_wxluasocket(size_t &count); + extern wxLuaBindString *wxLuaGetStringList_wxluasocket(size_t &count); + extern wxLuaBindEvent *wxLuaGetEventList_wxluasocket(size_t &count); + extern wxLuaBindObject *wxLuaGetObjectList_wxluasocket(size_t &count); + extern wxLuaBindMethod *wxLuaGetFunctionList_wxluasocket(size_t &count); + + // --------------------------------------------------------------------------- // Lua Tag Method Values and Tables for each Class // --------------------------------------------------------------------------- *************** *** 69,73 **** - // --------------------------------------------------------------------------- // Encapsulation Declarations - need to be public for other bindings. --- 80,83 ---- |
From: John L. <jr...@us...> - 2007-12-08 00:25:28
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14401/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlstate.cpp Log Message: Move the wxLuaState s_wxHashMapLuaState to the wxLuaState since that's what it gets Cleanup the wxlua_CallOverloadedFunction a little Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** wxlstate.cpp 7 Dec 2007 06:44:46 -0000 1.147 --- wxlstate.cpp 8 Dec 2007 00:25:24 -0000 1.148 *************** *** 108,111 **** --- 108,112 ---- if (hookData->m_debug_hook_break) { + // It's ok that we get the wxLuaState here since we're stopping anyway. wxLuaState wxlState(L); *************** *** 116,120 **** } ! if (hookData->m_lua_debug_hook_send_evt) { wxLuaState wxlState(L); --- 117,123 ---- } ! // Assume they've set the wxEvtHandler, ok if not, but it wouldn't make sense ! // We use wxLuaState::SendEvent() because it sets wxEvent::SetEventObject() for us. ! if (hookData->m_lua_debug_hook_send_evt) { wxLuaState wxlState(L); *************** *** 291,296 **** lua_rawget(L, -2); // get t[key] = value; pop key push value ! if (lua_isnumber(L, -1)) ! tag = (int)lua_tonumber(L, -1); lua_pop(L, 2); // pop object we pushed and the ref table --- 294,300 ---- lua_rawget(L, -2); // get t[key] = value; pop key push value ! tag = (int)lua_tonumber(L, -1); ! if ((tag == 0) && !lua_isnumber(L, -1)) // if !isnumber it returns 0 ! tag = LUA_NOREF; lua_pop(L, 2); // pop object we pushed and the ref table *************** *** 429,432 **** --- 433,451 ---- } + bool wxluaT_isuserdatatype(lua_State* L, int stack_idx, int tag) + { + if (wxlua_iswxuserdata(L, stack_idx)) + { + int stack_tag = wxluaT_gettag(L, stack_idx); + if ((g_wxluatag_NULL == stack_tag) || // FIXME, how to check when NULL is valid or not? + (g_wxluatag_wxLuaFunction == stack_tag) || + ((tag == WXLUAARG_String) && (wxlua_isderivedclass(L, stack_tag, g_wxluatag_wxString) >= 0)) || + (wxlua_isderivedclass(L, stack_tag, tag) >= 0)) + return true; + } + + return false; + } + void* LUACALL wxluaT_getuserdatatype(lua_State* L, int stack_idx, int tag) { *************** *** 862,880 **** } - bool wxlua_isuserdatatype(lua_State* L, int stack_idx, int tag) - { - if (wxlua_iswxuserdata(L, stack_idx)) - { - int stack_tag = wxluaT_gettag(L, stack_idx); - if ((g_wxluatag_NULL == stack_tag) || // FIXME, how to check when NULL is valid or not? - (g_wxluatag_wxLuaFunction == stack_tag) || - ((tag == WXLUAARG_String) && (wxlua_isderivedclass(L, stack_tag, g_wxluatag_wxString) >= 0)) || - (wxlua_isderivedclass(L, stack_tag, tag) >= 0)) - return true; - } - - return false; - } - wxString wxlua_getwxluatypename(int wxluaarg_tag) { --- 881,884 ---- *************** *** 1174,1178 **** int arrstr_tag = wxluaT_gettag(L, "wxArrayString"); ! if (wxlua_isuserdatatype(L, stack_idx, arrstr_tag)) { wxArrayString *arrStr = (wxArrayString *)wxluaT_getuserdatatype(L, stack_idx, arrstr_tag); --- 1178,1182 ---- int arrstr_tag = wxluaT_gettag(L, "wxArrayString"); ! if (wxluaT_isuserdatatype(L, stack_idx, arrstr_tag)) { wxArrayString *arrStr = (wxArrayString *)wxluaT_getuserdatatype(L, stack_idx, arrstr_tag); *************** *** 1210,1214 **** int arrstr_tag = wxluaT_gettag(L, "wxArrayString"); ! if (wxlua_isuserdatatype(L, stack_idx, arrstr_tag)) { wxSortedArrayString *arrStr = (wxSortedArrayString *)wxluaT_getuserdatatype(L, stack_idx, arrstr_tag); --- 1214,1218 ---- int arrstr_tag = wxluaT_gettag(L, "wxArrayString"); ! if (wxluaT_isuserdatatype(L, stack_idx, arrstr_tag)) { wxSortedArrayString *arrStr = (wxSortedArrayString *)wxluaT_getuserdatatype(L, stack_idx, arrstr_tag); *************** *** 1269,1273 **** int arrint_tag = wxluaT_gettag(L, "wxArrayInt"); ! if (wxlua_isuserdatatype(L, stack_idx, arrint_tag)) { wxArrayInt *arrInt = (wxArrayInt *)wxluaT_getuserdatatype(L, stack_idx, arrint_tag); --- 1273,1277 ---- int arrint_tag = wxluaT_gettag(L, "wxArrayInt"); ! if (wxluaT_isuserdatatype(L, stack_idx, arrint_tag)) { wxArrayInt *arrInt = (wxArrayInt *)wxluaT_getuserdatatype(L, stack_idx, arrint_tag); *************** *** 1495,1499 **** wxLuaDebugHookData* data = (wxLuaDebugHookData*)lua_touserdata(L, -1); ! lua_pop(L, 1); // pop number return data; --- 1499,1503 ---- wxLuaDebugHookData* data = (wxLuaDebugHookData*)lua_touserdata(L, -1); ! lua_pop(L, 1); // pop udata return data; *************** *** 1684,1689 **** //---------------------------------------------------------------------------- - wxHashMapLuaState wxLuaStateRefData::s_wxHashMapLuaState; - wxLuaStateRefData::wxLuaStateRefData(bool create_data) :m_lua_State(NULL), --- 1688,1691 ---- *************** *** 1818,1828 **** // The wxLuaState we pushed into the reg table is a light userdata so // it didn't get deleted. ! wxHashMapLuaState::iterator it = s_wxHashMapLuaState.find(m_lua_State); ! if (it != s_wxHashMapLuaState.end()) { wxLuaState* wxlState = it->second; wxlState->SetRefData(NULL); delete wxlState; ! s_wxHashMapLuaState.erase(m_lua_State); } --- 1820,1830 ---- // The wxLuaState we pushed into the reg table is a light userdata so // it didn't get deleted. ! wxHashMapLuaState::iterator it = wxLuaState::s_wxHashMapLuaState.find(m_lua_State); ! if (it != wxLuaState::s_wxHashMapLuaState.end()) { wxLuaState* wxlState = it->second; wxlState->SetRefData(NULL); delete wxlState; ! wxLuaState::s_wxHashMapLuaState.erase(m_lua_State); } *************** *** 1883,1932 **** } - wxLuaState wxLuaStateRefData::GetLuaState(lua_State* L) - { - // try our hashtable for faster lookup - wxHashMapLuaState::iterator it = s_wxHashMapLuaState.find(L); - if (it != s_wxHashMapLuaState.end()) - { - return wxLuaState(*it->second); - } - - // else it's a coroutine? look up the state data from Lua - wxLuaState* wxlState = NULL; - - // try to get the state we've stored - lua_pushlightuserdata(L, &wxlua_lreg_wxluastate_key); - lua_rawget( L, LUA_REGISTRYINDEX ); - - // if nothing was returned or it wasn't a ptr, abort - if ( lua_islightuserdata(L, -1) ) - wxlState = (wxLuaState*)lua_touserdata( L, -1 ); - - lua_pop(L, 1); // pop the wxLuaStateRefData or nil on failure - - if (wxlState && (wxlState->GetLuaState() != L)) - { - // Create a new wxLuaState for the coroutine and set the wxLuaStateData - // to the original wxLuaState's data - wxLuaStateRefData* refData = new wxLuaStateRefData(false); - refData->m_lua_State = L; - refData->m_lua_State_static = true; - refData->m_lua_State_coroutine = true; - - refData->m_wxlStateData = wxlState->GetLuaStateData(); - refData->m_own_stateData = false; - - wxLuaState wxlState2(false); - wxlState2.SetRefData(refData); - return wxlState2; - } - else if (wxlState) - { - return wxLuaState(*wxlState); // Ref it - } - - return wxNullLuaState; - } - //---------------------------------------------------------------------------- // wxLuaState --- 1885,1888 ---- *************** *** 1935,1938 **** --- 1891,1896 ---- IMPLEMENT_DYNAMIC_CLASS(wxLuaState, wxObject) + wxHashMapLuaState wxLuaState::s_wxHashMapLuaState; + #define M_WXLSTATEDATA ((wxLuaStateRefData*)m_refData) *************** *** 1985,1989 **** { // returns an invalid, wxNullLuaState on failure ! Ref(wxLuaStateRefData::GetLuaState(L)); } else // state_type == wxLUASTATE_USESTATE or wxLUASTATE_SETSTATE --- 1943,1947 ---- { // returns an invalid, wxNullLuaState on failure ! Ref(wxLuaState::GetwxLuaState(L)); } else // state_type == wxLUASTATE_USESTATE or wxLUASTATE_SETSTATE *************** *** 1998,2002 **** wxLuaState* hashState = new wxLuaState(false); hashState->SetRefData(m_refData); ! wxLuaStateRefData::s_wxHashMapLuaState[L] = hashState; // Stick us into the Lua registry table - push key, value --- 1956,1960 ---- wxLuaState* hashState = new wxLuaState(false); hashState->SetRefData(m_refData); ! wxLuaState::s_wxHashMapLuaState[L] = hashState; // Stick us into the Lua registry table - push key, value *************** *** 2086,2089 **** --- 2044,2049 ---- } + // -------------------------------------------------------------------------- + bool wxLuaState::Ok() const { *************** *** 2091,2094 **** --- 2051,2056 ---- } + // -------------------------------------------------------------------------- + void wxLuaState::Destroy() { *************** *** 2114,2117 **** --- 2076,2081 ---- } + // -------------------------------------------------------------------------- + lua_State* wxLuaState::GetLuaState() const { *************** *** 2126,2129 **** --- 2090,2141 ---- } + wxLuaState wxLuaState::GetwxLuaState(lua_State* L) + { + // try our hashtable for faster lookup + wxHashMapLuaState::iterator it = s_wxHashMapLuaState.find(L); + if (it != s_wxHashMapLuaState.end()) + { + return wxLuaState(*it->second); + } + + // else it's a coroutine? look up the state data from Lua + wxLuaState* wxlState = NULL; + + // try to get the state we've stored + lua_pushlightuserdata(L, &wxlua_lreg_wxluastate_key); + lua_rawget( L, LUA_REGISTRYINDEX ); + + // if nothing was returned or it wasn't a ptr, abort + if ( lua_islightuserdata(L, -1) ) + wxlState = (wxLuaState*)lua_touserdata( L, -1 ); + + lua_pop(L, 1); // pop the wxLuaStateRefData or nil on failure + + if (wxlState && (wxlState->GetLuaState() != L)) + { + // Create a new wxLuaState for the coroutine and set the wxLuaStateData + // to the original wxLuaState's data + wxLuaStateRefData* refData = new wxLuaStateRefData(false); + refData->m_lua_State = L; + refData->m_lua_State_static = true; + refData->m_lua_State_coroutine = true; + + refData->m_wxlStateData = wxlState->GetLuaStateData(); + refData->m_own_stateData = false; + + wxLuaState wxlState2(false); + wxlState2.SetRefData(refData); + return wxlState2; + } + else if (wxlState) + { + return wxLuaState(*wxlState); // Ref it + } + + return wxNullLuaState; + } + + // -------------------------------------------------------------------------- + void wxLuaState::SetEventHandler(wxEvtHandler *evtHandler) { *************** *** 2913,2917 **** { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return wxlua_isuserdatatype(M_WXLSTATEDATA->m_lua_State, stack_idx, tag); } --- 2925,2929 ---- { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return wxluaT_isuserdatatype(M_WXLSTATEDATA->m_lua_State, stack_idx, tag); } *************** *** 3053,3058 **** wxHashMapLuaState::iterator it; ! for (it = wxLuaStateRefData::s_wxHashMapLuaState.begin(); ! it != wxLuaStateRefData::s_wxHashMapLuaState.end(); ++it) { wxLuaState wxlState((wxLuaState*)it->second); --- 3065,3070 ---- wxHashMapLuaState::iterator it; ! for (it = wxLuaState::s_wxHashMapLuaState.begin(); ! it != wxLuaState::s_wxHashMapLuaState.end(); ++it) { wxLuaState wxlState((wxLuaState*)it->second); *************** *** 3782,3798 **** } - - wxArrayString wxLuaState::CreateMethodArgTagsMsg(struct wxLuaBindMethod* wxlMethod) - { - wxCHECK_MSG(Ok() && wxlMethod, wxArrayString(), wxT("Invalid wxLuaState or overloaded method table")); - return wxlua_CreateMethodArgTagsMsg(M_WXLSTATEDATA->m_lua_State, wxlMethod); - } - - int LUACALL wxLuaState::CallOverloadedFunction(struct wxLuaBindMethod* wxlMethod) - { - wxCHECK_MSG(Ok() && wxlMethod, 0, wxT("Invalid wxLuaState or overloaded method table")); - return wxlua_CallOverloadedFunction(M_WXLSTATEDATA->m_lua_State, wxlMethod); - } - //----------------------------------------------------------------------------- // wxLuaEvent --- 3794,3797 ---- Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** wxlbind.cpp 7 Dec 2007 02:24:56 -0000 1.101 --- wxlbind.cpp 8 Dec 2007 00:25:24 -0000 1.102 *************** *** 58,65 **** if (m_wxlMethod->basemethod) ! { ! wxLuaState wxlState(L); ! return wxlState.CallOverloadedFunction(m_wxlMethod); ! } return (*m_wxlMethod->funcs[0].func)(L); --- 58,62 ---- if (m_wxlMethod->basemethod) ! return wxlua_CallOverloadedFunction(L, m_wxlMethod); return (*m_wxlMethod->funcs[0].func)(L); *************** *** 96,112 **** { int i, arg; - int invalidArg = 0; // get number of arguments called from Lua ! int argCount = lua_gettop(L); ! int lua_argStart = 0; // don't remove the table, but do skip past it when counting args ! bool remove_table = wxluabind_removetableforcall(L, true); ! ! if (remove_table) { ! argCount--; ! lua_argStart++; } --- 93,106 ---- { int i, arg; // get number of arguments called from Lua ! int arg_count = lua_gettop(L); ! int arg_start = 0; // don't remove the table, but do skip past it when counting args ! if (wxluabind_removetableforcall(L, true)) { ! arg_count--; ! arg_start++; } *************** *** 119,124 **** { if (!WXLUA_HASBIT(method->funcs[i].type, WXLUAMETHOD_OVERLOAD) && ! (argCount >= method->funcs[i].minargs) && ! (argCount <= method->funcs[i].maxargs)) { funcArray.Add(&method->funcs[i]); --- 113,118 ---- { if (!WXLUA_HASBIT(method->funcs[i].type, WXLUAMETHOD_OVERLOAD) && ! (arg_count >= method->funcs[i].minargs) && ! (arg_count <= method->funcs[i].maxargs)) { funcArray.Add(&method->funcs[i]); *************** *** 130,142 **** } ! wxLuaBindCFunc* bestFunc = NULL; // store the last function that worked. // Look at the available functions in parallel, per arg ! for (arg = 0; (arg < argCount) && (funcArray.GetCount() != 0); arg++) { ! int arg_lua = arg+1+lua_argStart; // arg N in Lua int ltype = lua_type(L, arg_lua); ! for (i = 0; i < (int)funcArray.GetCount(); i++) { wxLuaBindCFunc* func = (wxLuaBindCFunc*)funcArray[i]; --- 124,138 ---- } ! wxLuaBindCFunc* bestFunc = NULL; // stores the last function that worked. ! int invalidArg = 0; // arg that failed ! int func_count = funcArray.GetCount(); // Look at the available functions in parallel, per arg ! for (arg = 0; (arg < arg_count) && (func_count != 0); ++arg) { ! int arg_lua = arg+1+arg_start; // arg N on the Lua stack int ltype = lua_type(L, arg_lua); ! for (i = 0; i < func_count; ++i) { wxLuaBindCFunc* func = (wxLuaBindCFunc*)funcArray[i]; *************** *** 144,153 **** invalidArg = arg; - int arg_wxlua = arg; // arg N in wxLuaArgTag - // does this method have any more arguments? ! if (!func->argtags[arg_wxlua]) { funcArray.RemoveAt(i); i--; continue; --- 140,148 ---- invalidArg = arg; // does this method have any more arguments? ! if (!func->argtags[arg]) { funcArray.RemoveAt(i); + func_count--; i--; continue; *************** *** 155,161 **** // get argument tag id ! int tag = (int)*(func->argtags[arg_wxlua]); ! //wxPrintf(wxT("ARG '%s' type %d argCount %d arg %d arg_lua %d arg_wxlua %d ltype %d wxtype %d func_count %d/%d\n"), lua2wx(wxlMethod->name).c_str(), func->type, argCount, arg, arg_lua, arg_wxlua, ltype, tag, i, funcArray.GetCount()); // Does the Lua type match the wxlua arg tag type --- 150,156 ---- // get argument tag id ! int tag = (int)*(func->argtags[arg]); ! //wxPrintf(wxT("ARG '%s' type %d arg_count %d arg %d arg_lua %d ltype %d wxtype %d func_count %d/%d\n"), lua2wx(wxlMethod->name).c_str(), func->type, arg_count, arg, arg_lua, ltype, tag, i, funcArray.GetCount()); // Does the Lua type match the wxlua arg tag type *************** *** 165,170 **** if ((is_ok == -1) || ((is_ok == 0) && (tag == WXLUAARG_String))) { ! is_ok = (wxlua_isuserdatatype(L, arg_lua, tag) || ! (tag == g_wxluatag_NULL)) ? 1 : 0; } --- 160,165 ---- if ((is_ok == -1) || ((is_ok == 0) && (tag == WXLUAARG_String))) { ! is_ok = (wxluaT_isuserdatatype(L, arg_lua, tag) || ! (tag == g_wxluatag_NULL)) ? 1 : 0; } *************** *** 173,176 **** --- 168,172 ---- { funcArray.RemoveAt(i); + func_count--; i--; continue; *************** *** 182,186 **** // Note that the top function is the one that is highest in the // derived functions from any baseclasses and should be the best choice. ! if (funcArray.GetCount() > 0) { lua_CFunction func = ((wxLuaBindCFunc*)funcArray[0])->func; --- 178,182 ---- // Note that the top function is the one that is highest in the // derived functions from any baseclasses and should be the best choice. ! if (funcArray.GetCount() == 1) { lua_CFunction func = ((wxLuaBindCFunc*)funcArray[0])->func; *************** *** 197,206 **** // Build an error message wxString fnCall = name + wxT("("); ! for (arg = 0; arg < argCount; arg++) { ! if (arg > 0) ! fnCall += wxT(", "); ! int ltype = lua_type(L, arg+1+lua_argStart); if (ltype != LUA_TUSERDATA) --- 193,201 ---- // Build an error message wxString fnCall = name + wxT("("); ! for (arg = 0; arg < arg_count; arg++) { ! if (arg > 0) fnCall += wxT(", "); ! int ltype = lua_type(L, arg+1+arg_start); if (ltype != LUA_TUSERDATA) *************** *** 210,214 **** else { ! int tag = wxluaT_gettag(L, arg+1+lua_argStart); fnCall += wxluaT_gettagname(L, tag); } --- 205,209 ---- else { ! int tag = wxluaT_gettag(L, arg+1+arg_start); fnCall += wxluaT_gettagname(L, tag); } |
From: John L. <jr...@us...> - 2007-12-08 00:25:28
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14401/wxLua/modules/wxlua/include Modified Files: wxlstate.h Log Message: Move the wxLuaState s_wxHashMapLuaState to the wxLuaState since that's what it gets Cleanup the wxlua_CallOverloadedFunction a little Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** wxlstate.h 7 Dec 2007 06:44:46 -0000 1.102 --- wxlstate.h 8 Dec 2007 00:25:22 -0000 1.103 *************** *** 213,216 **** --- 213,218 ---- // Get the tag for the class with the given name WXDLLIMPEXP_WXLUA int LUACALL wxluaT_gettag(lua_State* L, const char* name); + // Is the item at stack_idx of the userdata type with or derived from the the given tag. + WXDLLIMPEXP_WXLUA bool wxluaT_isuserdatatype(lua_State* L, int stack_idx, int tag); // Get the userdata object at the stack_idx that is of the class type tag or a *************** *** 301,306 **** // (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. - WXDLLIMPEXP_WXLUA bool wxlua_isuserdatatype(lua_State* L, int stack_idx, int tag); // Get a human readable name for the predefined WXLUAARG_XXX or s_wxluaarg_XXX tags. // returns empty string if the tag was not one of the predefined types. --- 303,306 ---- *************** *** 499,503 **** // if 'force' = true then make sure all wxWindows are destroyed. bool CloseLuaState(bool force); ! // clear all wxLuaCallbacks on destruction void ClearCallbacks(); --- 499,503 ---- // if 'force' = true then make sure all wxWindows are destroyed. bool CloseLuaState(bool force); ! // clear all wxLuaCallbacks and wxLuaWinDestroyCallbacks on destruction void ClearCallbacks(); *************** *** 510,524 **** wxLuaStateData* m_wxlStateData; // the data shared for this state bool m_own_stateData; // not a coroutine when true, so delete it when done - - // Get the wxLuaState from the corresponding lua_State - // returns wxNullLuaState if none found. - static wxLuaState GetLuaState(lua_State* L); - // A mapping between hashmap[lua_State* L] = *wxLuaState - // Note: The hashed new wxLuaState is not Refed since we want to know when - // the ref count goes to 1 for cleanup and it is deleted when - // it's wxLuaStateRefData is finally deleted. - // Note: The coroutine lua_States are not hashed since we cannot know when - // they are deleted. We create wxLuaStates for them on the fly. - static wxHashMapLuaState s_wxHashMapLuaState; }; --- 510,513 ---- *************** *** 561,564 **** --- 550,555 ---- virtual ~wxLuaState() { Destroy(); } + // ----------------------------------------------------------------------- + // Ref the given wxLuaState void Create(const wxLuaState& wxlState); *************** *** 608,611 **** --- 599,615 ---- // ----------------------------------------------------------------------- + // Get the wxLuaState from the corresponding lua_State + // returns wxNullLuaState if none found. + static wxLuaState GetwxLuaState(lua_State* L); + // A mapping between hashmap[lua_State* L] = wxLuaState* + // Note: The hashed new wxLuaState is not Refed since we want to know when + // the ref count goes to 1 for cleanup and it is deleted when + // it's wxLuaStateRefData is finally deleted. + // Note: The coroutine lua_States are not hashed since we cannot know when + // they are created or deleted. We must create wxLuaStates for them on the fly. + static wxHashMapLuaState s_wxHashMapLuaState; + + // ----------------------------------------------------------------------- + // Set the event handler that the wxLuaEvents from this will be sent to, can be NULL. // See wxEVT_LUA_XXX for a list of possible events that may be sent. *************** *** 1140,1148 **** void GetGlobals(); - // Return a human readable string of the args for the functions in the method - wxArrayString CreateMethodArgTagsMsg(struct wxLuaBindMethod* method); - // overloaded function call helper - int LUACALL CallOverloadedFunction(struct wxLuaBindMethod* method); - // ----------------------------------------------------------------------- // LUA_PATH --- 1144,1147 ---- |
From: John L. <jr...@us...> - 2007-12-07 06:45:17
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26745/wxLua/bindings/wxwidgets Modified Files: wxbase_override.hpp wxcore_override.hpp wxhtml_override.hpp wxxml_override.hpp 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: wxhtml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxhtml_override.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxhtml_override.hpp 7 Dec 2007 02:13:10 -0000 1.3 --- wxhtml_override.hpp 7 Dec 2007 06:44:41 -0000 1.4 *************** *** 71,75 **** case LUA_TSTRING: { ! wxString param = wxlua_getwxstringtype(L, 3); returns = self->Find(condition, ¶m); } --- 71,75 ---- case LUA_TSTRING: { ! wxString param = wxlua_getwxStringtype(L, 3); returns = self->Find(condition, ¶m); } *************** *** 102,106 **** wxColour *retColour = new wxColour; // const wxString& par ! wxString par = wxlua_getwxstringtype(L, 2); // get this wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlTag); --- 102,106 ---- wxColour *retColour = new wxColour; // const wxString& par ! wxString par = wxlua_getwxStringtype(L, 2); // get this wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlTag); *************** *** 123,127 **** int value; // const wxString& par ! wxString par = wxlua_getwxstringtype(L, 2); // get this wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlTag); --- 123,127 ---- int value; // const wxString& par ! wxString par = wxlua_getwxStringtype(L, 2); // get this wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlTag); *************** *** 180,186 **** // wxString fixed_face ! wxString fixed_face = wxlua_getwxstringtype(L, 3); // wxString normal_face ! wxString normal_face = wxlua_getwxstringtype(L, 2); // get this wxHtmlWinParser *self = (wxHtmlWinParser *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlWinParser); --- 180,186 ---- // wxString fixed_face ! wxString fixed_face = wxlua_getwxStringtype(L, 3); // wxString normal_face ! wxString normal_face = wxlua_getwxStringtype(L, 2); // get this wxHtmlWinParser *self = (wxHtmlWinParser *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlWinParser); *************** *** 235,241 **** // wxString fixed_face ! wxString fixed_face = wxlua_getwxstringtype(L, 3); // wxString normal_face ! wxString normal_face = wxlua_getwxstringtype(L, 2); // get this wxHtmlWindow *self = (wxHtmlWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlWindow); --- 235,241 ---- // wxString fixed_face ! wxString fixed_face = wxlua_getwxStringtype(L, 3); // wxString normal_face ! wxString normal_face = wxlua_getwxStringtype(L, 2); // get this wxHtmlWindow *self = (wxHtmlWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlWindow); *************** *** 258,262 **** int argCount = lua_gettop(L); // const wxString name = "wxLuaHtmlWindow" ! const wxString name = (argCount >= 6 ? wxlua_getwxstringtype(L, 6) : wxString(wxT("wxLuaHtmlWindow"))); // long style = wxHW_SCROLLBAR_AUTO long style = (argCount >= 5 ? (long)wxlua_getintegertype(L, 5) : wxHW_SCROLLBAR_AUTO); --- 258,262 ---- int argCount = lua_gettop(L); // const wxString name = "wxLuaHtmlWindow" ! const wxString name = (argCount >= 6 ? wxlua_getwxStringtype(L, 6) : wxString(wxT("wxLuaHtmlWindow"))); // long style = wxHW_SCROLLBAR_AUTO long style = (argCount >= 5 ? (long)wxlua_getintegertype(L, 5) : wxHW_SCROLLBAR_AUTO); Index: wxbase_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxbase_override.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxbase_override.hpp 7 Dec 2007 02:13:09 -0000 1.7 --- wxbase_override.hpp 7 Dec 2007 06:44:41 -0000 1.8 *************** *** 35,39 **** { bool returns; ! wxString var = wxlua_getwxstringtype(L, 1); wxString value; // call wxGetEnv --- 35,39 ---- { bool returns; ! wxString var = wxlua_getwxStringtype(L, 1); wxString value; // call wxGetEnv *************** *** 98,104 **** size_t maxMatches = (argCount >= 4 ? (size_t)wxlua_getintegertype(L, 4) : 0); // const wxString& replacement ! wxString replacement = wxlua_getwxstringtype(L, 3); // wxString* text ! wxString text = wxlua_getwxstringtype(L, 2); // get this wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxRegEx); --- 98,104 ---- size_t maxMatches = (argCount >= 4 ? (size_t)wxlua_getintegertype(L, 4) : 0); // const wxString& replacement ! wxString replacement = wxlua_getwxStringtype(L, 3); // wxString* text ! wxString text = wxlua_getwxStringtype(L, 2); // get this wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxRegEx); *************** *** 120,126 **** int returns; // const wxString& replacement ! wxString replacement = wxlua_getwxstringtype(L, 3); // wxString* text ! wxString text = wxlua_getwxstringtype(L, 2); // get this wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxRegEx); --- 120,126 ---- int returns; // const wxString& replacement ! wxString replacement = wxlua_getwxStringtype(L, 3); // wxString* text ! wxString text = wxlua_getwxStringtype(L, 2); // get this wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxRegEx); *************** *** 142,148 **** int returns; // const wxString& replacement ! wxString replacement = wxlua_getwxstringtype(L, 3); // wxString* text ! wxString text = wxlua_getwxstringtype(L, 2); // get this wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxRegEx); --- 142,148 ---- int returns; // const wxString& replacement ! wxString replacement = wxlua_getwxStringtype(L, 3); // wxString* text ! wxString text = wxlua_getwxStringtype(L, 2); // get this wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxRegEx); *************** *** 189,195 **** int argCount = lua_gettop(L); // wxString defaultVal ! wxString defaultVal = (argCount >= 3 ? wxlua_getwxstringtype(L, 3) : wxString(wxEmptyString)); // const wxString& key ! wxString key = wxlua_getwxstringtype(L, 2); // get this wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); --- 189,195 ---- int argCount = lua_gettop(L); // wxString defaultVal ! wxString defaultVal = (argCount >= 3 ? wxlua_getwxStringtype(L, 3) : wxString(wxEmptyString)); // const wxString& key ! wxString key = wxlua_getwxStringtype(L, 2); // get this wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); *************** *** 215,219 **** long defaultVal = (argCount >= 3 ? (long)wxlua_getnumbertype(L, 3) : 0); // const wxString& key ! wxString key = wxlua_getwxstringtype(L, 2); // get this wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); --- 215,219 ---- long defaultVal = (argCount >= 3 ? (long)wxlua_getnumbertype(L, 3) : 0); // const wxString& key ! wxString key = wxlua_getwxStringtype(L, 2); // get this wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); *************** *** 239,243 **** double defaultVal = (argCount >= 3 ? (double)wxlua_getnumbertype(L, 3) : 0); // const wxString& key ! wxString key = wxlua_getwxstringtype(L, 2); // get this wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); --- 239,243 ---- double defaultVal = (argCount >= 3 ? (double)wxlua_getnumbertype(L, 3) : 0); // const wxString& key ! wxString key = wxlua_getwxStringtype(L, 2); // get this wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); *************** *** 262,266 **** // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlua_getintegertype(L, 3) : 0); ! wxString str = (argCount >= 2 ? wxlua_getwxstringtype(L, 2) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); --- 262,266 ---- // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlua_getintegertype(L, 3) : 0); ! wxString str = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); *************** *** 287,291 **** // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlua_getintegertype(L, 3) : 0); ! wxString str = (argCount >= 2 ? wxlua_getwxstringtype(L, 2) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); --- 287,291 ---- // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlua_getintegertype(L, 3) : 0); ! wxString str = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxConfigBase); *************** *** 363,367 **** int argCount = lua_gettop(L); // const wxString str = "" ! const wxString str = (argCount >= 1 ? wxlua_getwxstringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxString(str); --- 363,367 ---- int argCount = lua_gettop(L); // const wxString str = "" ! const wxString str = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxString(str); *************** *** 383,387 **** wxClassInfo *returns; // const wxString &name ! wxString name = wxlua_getwxstringtype(L, 1); // call constructor returns = wxClassInfo::FindClass((wxChar *)name.c_str()); --- 383,387 ---- wxClassInfo *returns; // const wxString &name ! wxString name = wxlua_getwxStringtype(L, 1); // call constructor returns = wxClassInfo::FindClass((wxChar *)name.c_str()); *************** *** 474,478 **** { for (idx = 1; idx < argCount; ++idx) ! returns->Add(wxlua_getwxstringtype(L, idx)); } } --- 474,478 ---- { for (idx = 1; idx < argCount; ++idx) ! returns->Add(wxlua_getwxStringtype(L, idx)); } } *************** *** 615,619 **** wxString path; // const wxString& fullpath ! wxString fullpath = wxlua_getwxstringtype(L, 2); // call SplitPath wxFileName::SplitPath(fullpath, &path, &name, &ext, format); --- 615,619 ---- wxString path; // const wxString& fullpath ! wxString fullpath = wxlua_getwxStringtype(L, 2); // call SplitPath wxFileName::SplitPath(fullpath, &path, &name, &ext, format); *************** *** 640,644 **** wxString volume; // const wxString& fullpath ! wxString fullpath = wxlua_getwxstringtype(L, 2); // call SplitPath wxFileName::SplitPath(fullpath, &volume, &path, &name, &ext, format); --- 640,644 ---- wxString volume; // const wxString& fullpath ! wxString fullpath = wxlua_getwxStringtype(L, 2); // call SplitPath wxFileName::SplitPath(fullpath, &volume, &path, &name, &ext, format); *************** *** 662,666 **** wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlua_getintegertype(L, 3) : wxPATH_NATIVE); // const wxString fullpath ! const wxString fullpath = wxlua_getwxstringtype(L, 2); wxString volume; wxString path; --- 662,666 ---- wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlua_getintegertype(L, 3) : wxPATH_NATIVE); // const wxString fullpath ! const wxString fullpath = wxlua_getwxStringtype(L, 2); wxString volume; wxString path; *************** *** 684,688 **** int flags = (argCount >= 3 ? (int)wxlua_getintegertype(L, 3) : wxDIR_DEFAULT); // const wxString& filespec = "" ! wxString filespec = (argCount >= 2 ? wxlua_getwxstringtype(L, 2) : wxString(wxT(""))); // wxString * filename wxString filename; --- 684,688 ---- int flags = (argCount >= 3 ? (int)wxlua_getintegertype(L, 3) : wxDIR_DEFAULT); // const wxString& filespec = "" ! wxString filespec = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxT(""))); // wxString * filename wxString filename; *************** *** 728,736 **** int flags = (argCount >= 4 ? (int)wxlua_getintegertype(L, 3) : wxDIR_DEFAULT); // const wxString& filespec = "" ! wxString filespec = (argCount >= 3 ? wxlua_getwxstringtype(L, 2) : wxString(wxT(""))); // wxArrayString *files wxArrayString files; // const wxString& dirname ! wxString dirname = wxlua_getwxstringtype(L, 1); // call GetAllFiles returns = wxDir::GetAllFiles(dirname, &files, filespec, flags); --- 728,736 ---- int flags = (argCount >= 4 ? (int)wxlua_getintegertype(L, 3) : wxDIR_DEFAULT); // const wxString& filespec = "" ! wxString filespec = (argCount >= 3 ? wxlua_getwxStringtype(L, 2) : wxString(wxT(""))); // wxArrayString *files wxArrayString files; // const wxString& dirname ! wxString dirname = wxlua_getwxStringtype(L, 1); // call GetAllFiles returns = wxDir::GetAllFiles(dirname, &files, filespec, flags); *************** *** 797,801 **** bool returns; // wxString desc ! wxString desc; // = wxlua_getwxstringtype(L, 2); // get this wxFileType * self = (wxFileType *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFileType); --- 797,801 ---- bool returns; // wxString desc ! wxString desc; // = wxlua_getwxStringtype(L, 2); // get this wxFileType * self = (wxFileType *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFileType); *************** *** 818,822 **** const wxFileType::MessageParameters * params = (const wxFileType::MessageParameters *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxFileType_MessageParameters); // wxString printCmd ! wxString printCmd; // = wxlua_getwxstringtype(L, 2); // get this wxFileType * self = (wxFileType *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFileType); --- 818,822 ---- const wxFileType::MessageParameters * params = (const wxFileType::MessageParameters *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxFileType_MessageParameters); // wxString printCmd ! wxString printCmd; // = wxlua_getwxStringtype(L, 2); // get this wxFileType * self = (wxFileType *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFileType); Index: wxcore_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxcore_override.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxcore_override.hpp 7 Dec 2007 02:13:10 -0000 1.7 --- wxcore_override.hpp 7 Dec 2007 06:44:41 -0000 1.8 *************** *** 810,814 **** int flags = (argCount >= 2 ? (int)wxlua_getintegertype(L, 2) : 0); // const wxString command ! const wxString command = wxlua_getwxstringtype(L, 1); // call wxExecute wxArrayString output; --- 810,814 ---- int flags = (argCount >= 2 ? (int)wxlua_getintegertype(L, 2) : 0); // const wxString command ! const wxString command = wxlua_getwxStringtype(L, 1); // call wxExecute wxArrayString output; *************** *** 832,836 **** int flags = (argCount >= 2 ? (int)wxlua_getintegertype(L, 2) : 0); // const wxString command ! const wxString command = wxlua_getwxstringtype(L, 1); // call wxExecute wxArrayString output; --- 832,836 ---- int flags = (argCount >= 2 ? (int)wxlua_getintegertype(L, 2) : 0); // const wxString command ! const wxString command = wxlua_getwxStringtype(L, 1); // call wxExecute wxArrayString output; *************** *** 940,946 **** int count = 0; wxLuaSmartStringArray choices = wxlua_getwxStringarray(L, 4, count); // const wxString& caption ! wxString caption = wxlua_getwxstringtype(L, 3); // const wxString& message ! wxString message = wxlua_getwxstringtype(L, 2); // wxArrayInt& selections wxLuaSmartwxArrayInt selections = wxlua_getwxArrayInt(L, 1); --- 940,946 ---- int count = 0; wxLuaSmartStringArray choices = wxlua_getwxStringarray(L, 4, count); // const wxString& caption ! wxString caption = wxlua_getwxStringtype(L, 3); // const wxString& message ! wxString message = wxlua_getwxStringtype(L, 2); // wxArrayInt& selections wxLuaSmartwxArrayInt selections = wxlua_getwxArrayInt(L, 1); *************** *** 1004,1010 **** wxLuaSmartwxArrayString choices = wxlua_getwxArrayString(L, 4); // const wxString caption ! const wxString caption = wxlua_getwxstringtype(L, 3); // const wxString message ! const wxString message = wxlua_getwxstringtype(L, 2); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); --- 1004,1010 ---- wxLuaSmartwxArrayString choices = wxlua_getwxArrayString(L, 4); // const wxString caption ! const wxString caption = wxlua_getwxStringtype(L, 3); // const wxString message ! const wxString message = wxlua_getwxStringtype(L, 2); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); *************** *** 1029,1033 **** int argCount = lua_gettop(L); // const wxString newmsg = "" ! const wxString newmsg = (argCount >= 3 ? wxlua_getwxstringtype(L, 3) : wxString(wxEmptyString)); // int value = -1 int value = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : -1); --- 1029,1033 ---- int argCount = lua_gettop(L); // const wxString newmsg = "" ! const wxString newmsg = (argCount >= 3 ? wxlua_getwxStringtype(L, 3) : wxString(wxEmptyString)); // int value = -1 int value = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : -1); *************** *** 1380,1384 **** bool interactive = (argCount >= 5 ? wxlua_getbooleantype(L, 4) : true); // const wxString &faceName = wxEmptyString ! wxString faceName = (argCount >= 4 ? wxlua_getwxstringtype(L, 3) : wxString(wxT(""))); // wxFontEncoding *altEncoding wxFontEncoding altEncoding; --- 1380,1384 ---- bool interactive = (argCount >= 5 ? wxlua_getbooleantype(L, 4) : true); // const wxString &faceName = wxEmptyString ! wxString faceName = (argCount >= 4 ? wxlua_getwxStringtype(L, 3) : wxString(wxT(""))); // wxFontEncoding *altEncoding wxFontEncoding altEncoding; *************** *** 1615,1619 **** wxCoord w; ! wxString string = wxlua_getwxstringtype(L, 2); // get this wxDC *self = (wxDC *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDC); --- 1615,1619 ---- wxCoord w; ! wxString string = wxlua_getwxStringtype(L, 2); // get this wxDC *self = (wxDC *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDC); *************** *** 1642,1646 **** wxCoord w; ! wxString string = wxlua_getwxstringtype(L, 2); // get this wxDC *self = (wxDC *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDC); --- 1642,1646 ---- wxCoord w; ! wxString string = wxlua_getwxStringtype(L, 2); // get this wxDC *self = (wxDC *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDC); *************** *** 2023,2027 **** bool returns; // wxString buf ! wxString buf = wxlua_getwxstringtype(L, 2); // get this wxDocManager * self = (wxDocManager *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDocManager); --- 2023,2027 ---- bool returns; // wxString buf ! wxString buf = wxlua_getwxStringtype(L, 2); // get this wxDocManager * self = (wxDocManager *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDocManager); *************** *** 2041,2045 **** { // wxString name ! wxString name = wxlua_getwxstringtype(L, 2); // get this wxDocument * self = (wxDocument *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDocument); --- 2041,2045 ---- { // wxString name ! wxString name = wxlua_getwxStringtype(L, 2); // get this wxDocument * self = (wxDocument *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDocument); *************** *** 2102,2106 **** long style = (argCount >= 3 ? (long)wxlua_getintegertype(L, 3) : 0); // const wxString& title = "" ! wxString title = (argCount >= 2 ? wxlua_getwxstringtype(L, 2) : wxString(wxT(""))); // int table if (lua_istable(L, 1)) --- 2102,2106 ---- long style = (argCount >= 3 ? (long)wxlua_getintegertype(L, 3) : 0); // const wxString& title = "" ! wxString title = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxT(""))); // int table if (lua_istable(L, 1)) *************** *** 2136,2140 **** lua_pushnumber(L, 2); lua_gettable(L, -2); ! menuText = wxlua_getwxstringtype(L, -1); lua_pop(L, 1); --- 2136,2140 ---- lua_pushnumber(L, 2); lua_gettable(L, -2); ! menuText = wxlua_getwxStringtype(L, -1); lua_pop(L, 1); *************** *** 2142,2146 **** lua_gettable(L, -2); if (lua_isstring(L, -1)) ! helpText = wxlua_getwxstringtype(L, -1); lua_pop(L, 1); --- 2142,2146 ---- lua_gettable(L, -2); if (lua_isstring(L, -1)) ! helpText = wxlua_getwxStringtype(L, -1); lua_pop(L, 1); *************** *** 2229,2235 **** wxItemKind itemkind = (wxItemKind)(argCount >= 5 ? wxlua_getintegertype(L, 5) : wxITEM_NORMAL); // const wxString& help = wxEmptyString ! wxString help = (argCount >= 4 ? wxlua_getwxstringtype(L, 4) : wxString(wxEmptyString)); // const wxString& text = wxEmptyString ! wxString text = (argCount >= 3 ? wxlua_getwxstringtype(L, 3) : wxString(wxEmptyString)); // int id = wxID_SEPARATOR int id = (argCount >= 2 ? (int)wxlua_getintegertype(L, 2) : wxID_SEPARATOR); --- 2229,2235 ---- wxItemKind itemkind = (wxItemKind)(argCount >= 5 ? wxlua_getintegertype(L, 5) : wxITEM_NORMAL); // const wxString& help = wxEmptyString ! wxString help = (argCount >= 4 ? wxlua_getwxStringtype(L, 4) : wxString(wxEmptyString)); // const wxString& text = wxEmptyString ! wxString text = (argCount >= 3 ? wxlua_getwxStringtype(L, 3) : wxString(wxEmptyString)); // int id = wxID_SEPARATOR int id = (argCount >= 2 ? (int)wxlua_getintegertype(L, 2) : wxID_SEPARATOR); *************** *** 2530,2534 **** int h; // const wxString& string ! wxString string = wxlua_getwxstringtype(L, 2); // get this wxWindow *self = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); --- 2530,2534 ---- int h; // const wxString& string ! wxString string = wxlua_getwxStringtype(L, 2); // get this wxWindow *self = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); *************** *** 2765,2769 **** wxLuaObject * pObject = (argCount >= 2 ? (wxLuaObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxLuaObject) : NULL); // const wxString title = "Printout" ! const wxString title = (argCount >= 1 ? wxlua_getwxstringtype(L, 1) : wxString(wxT("Printout"))); // call constructor returns = new wxLuaPrintout(wxlState, title, pObject); --- 2765,2769 ---- wxLuaObject * pObject = (argCount >= 2 ? (wxLuaObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxLuaObject) : NULL); // const wxString title = "Printout" ! const wxString title = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxT("Printout"))); // call constructor returns = new wxLuaPrintout(wxlState, title, pObject); Index: wxxml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxxml_override.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxxml_override.hpp 7 Dec 2007 02:13:10 -0000 1.3 --- wxxml_override.hpp 7 Dec 2007 06:44:41 -0000 1.4 *************** *** 22,28 **** wxXmlProperty * props = (wxXmlProperty *)wxluaT_getuserdatatype(L, 5, s_wxluatag_wxXmlProperty); // const wxString content ! const wxString content = wxlua_getwxstringtype(L, 4); // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxXmlNodeType type wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); --- 22,28 ---- wxXmlProperty * props = (wxXmlProperty *)wxluaT_getuserdatatype(L, 5, s_wxluatag_wxXmlProperty); // const wxString content ! const wxString content = wxlua_getwxStringtype(L, 4); // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 3); // wxXmlNodeType type wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); *************** *** 71,75 **** wxString value; // const wxString& propName ! wxString propName = wxlua_getwxstringtype(L, 2); // get this wxXmlNode *self = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlNode); --- 71,75 ---- wxString value; // const wxString& propName ! wxString propName = wxlua_getwxStringtype(L, 2); // get this wxXmlNode *self = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlNode); |
From: John L. <jr...@us...> - 2007-12-07 06:45:15
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26745/wxLua/bindings/wxlua Modified Files: override.hpp 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: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** override.hpp 7 Dec 2007 02:13:09 -0000 1.11 --- override.hpp 7 Dec 2007 06:44:41 -0000 1.12 *************** *** 14,23 **** static int LUACALL wxLua_function_CompileLuaScript(lua_State *L) { - wxLuaState wxlState(L); int returns; // const wxString fileName ! const wxString fileName = wxlState.GetwxStringType(2); // const wxString luaScript ! const wxString luaScript = wxlState.GetwxStringType(1); wxString errMsg; int line_num = -1; --- 14,22 ---- static int LUACALL wxLua_function_CompileLuaScript(lua_State *L) { int returns; // const wxString fileName ! const wxString fileName = wxlua_getwxStringtype(L, 2); // const wxString luaScript ! const wxString luaScript = wxlua_getwxStringtype(L, 1); wxString errMsg; int line_num = -1; *************** *** 26,30 **** // push the result number lua_pushnumber(L, returns); ! wxlState.lua_PushString(errMsg); lua_pushnumber(L, line_num); return 3; --- 25,29 ---- // push the result number lua_pushnumber(L, returns); ! wxlua_pushwxString(L, errMsg); lua_pushnumber(L, line_num); return 3; *************** *** 76,81 **** static int LUACALL wxLua_function_type(lua_State *L) { - wxLuaState wxlState(L); - int ltype = lua_type(L, 1); const char* ltypename = lua_typename(L, ltype); --- 75,78 ---- *************** *** 91,95 **** wxluaarg_tag = wxlua_getwxluatype(ltype); ! wxString tagName = wxlState.GetLuaTagName(wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the results --- 88,92 ---- wxluaarg_tag = wxlua_getwxluatype(ltype); ! wxString tagName = wxluaT_gettagname(L, wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the results *************** *** 108,119 **** static int LUACALL wxLua_function_typename(lua_State *L) { - wxLuaState wxlState(L); wxString returns; // int wxluaarg_tag int wxluaarg_tag = (int)wxlua_getnumbertype(L, 1); // call wxlua_getwxluatypename ! returns = wxlState.GetLuaTagName(wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the result string ! wxlState.lua_PushString(returns); return 1; --- 105,115 ---- static int LUACALL wxLua_function_typename(lua_State *L) { wxString returns; // int wxluaarg_tag int wxluaarg_tag = (int)wxlua_getnumbertype(L, 1); // call wxlua_getwxluatypename ! returns = wxluaT_gettagname(L, wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the result string ! wxlua_pushwxString(L, returns); return 1; *************** *** 168,174 **** int LUACALL wxluabind_wxLuaBindCFunc__index(lua_State* L) { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - void **ptr = (void **)lua_touserdata(L, 1); wxLuaBindCFunc* wxlCFunc= (wxLuaBindCFunc*)*ptr; --- 164,167 ---- *************** *** 252,258 **** int LUACALL wxluabind_wxLuaBindMethod__index(lua_State* L) { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - void **ptr = (void **)lua_touserdata(L, 1); wxLuaBindMethod* wxlMethod = (wxLuaBindMethod*)*ptr; --- 245,248 ---- *************** *** 357,363 **** int LUACALL wxluabind_wxLuaBindClass__index(lua_State* L) { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - void **ptr = (void **)lua_touserdata(L, 1); wxLuaBindClass* wxlClass = (wxLuaBindClass*)*ptr; --- 347,350 ---- *************** *** 419,426 **** if (wxlClass->classInfo) { ! const wxLuaBindClass* classInfoClass = wxlState.GetBindClass("wxClassInfo"); if (classInfoClass) { ! wxlState.PushUserDataType(*classInfoClass->class_tag, wxlClass->classInfo); return 1; } --- 406,413 ---- if (wxlClass->classInfo) { ! const wxLuaBindClass* classInfoClass = wxluaT_getclass(L, "wxClassInfo"); if (classInfoClass) { ! wxluaT_pushuserdatatype(L, *classInfoClass->class_tag, wxlClass->classInfo); return 1; } *************** *** 504,510 **** int LUACALL wxluabind_wxLuaBinding__index(lua_State* L) { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - void **ptr = (void **)lua_touserdata(L, 1); wxLuaBinding* wxlBinding = (wxLuaBinding*)*ptr; --- 491,494 ---- *************** *** 687,693 **** lua_pushstring(L, "object"); if (wxlObject->objPtr != 0) ! wxlState.wxluaT_PushUserTag(wxlObject->objPtr, *wxlObject->class_tag, false); else ! wxlState.wxluaT_PushUserTag(*wxlObject->pObjPtr, *wxlObject->class_tag, false); lua_rawset(L, -3); --- 671,677 ---- lua_pushstring(L, "object"); if (wxlObject->objPtr != 0) ! wxluaT_pushusertag(L, wxlObject->objPtr, *wxlObject->class_tag, false); else ! wxluaT_pushusertag(L, *wxlObject->pObjPtr, *wxlObject->class_tag, false); lua_rawset(L, -3); *************** *** 718,728 **** wxluabind_removetableforcall(L); wxLuaState wxlState(L); wxLuaObject *returns; // call constructor returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); // return the number of parameters return 1; --- 702,713 ---- wxluabind_removetableforcall(L); wxLuaState wxlState(L); + wxLuaObject *returns; // call constructor 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); // return the number of parameters return 1; *************** *** 734,740 **** static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxLuaObject *self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call SetObject self->SetObject(1); --- 719,724 ---- static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L) { // get this ! wxLuaObject *self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); // call SetObject self->SetObject(1); *************** *** 748,754 **** static int LUACALL wxLua_wxLuaObject_GetObject(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxLuaObject *self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call GetObject that push the item onto the stack, or nil if (self->GetObject()) --- 732,737 ---- static int LUACALL wxLua_wxLuaObject_GetObject(lua_State *L) { // get this ! wxLuaObject *self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); // call GetObject that push the item onto the stack, or nil if (self->GetObject()) |
From: John L. <jr...@us...> - 2007-12-07 06:45:15
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26745/wxLua/apps/wxluacan/src Modified Files: wxluacan.cpp 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: wxluacan.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** wxluacan.cpp 7 Dec 2007 02:13:09 -0000 1.34 --- wxluacan.cpp 7 Dec 2007 06:44:40 -0000 1.35 *************** *** 291,295 **** wxlCanObjScript *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // double y double y = (double)wxlua_getnumbertype(L, 2); --- 291,295 ---- wxlCanObjScript *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 3); // double y double y = (double)wxlua_getnumbertype(L, 2); *************** *** 329,333 **** { // const wxString script ! const wxString script = wxlua_getwxstringtype(L, 2); // get this wxlCanObjAddScript * self = (wxlCanObjAddScript *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObjAddScript); --- 329,333 ---- { // const wxString script ! const wxString script = wxlua_getwxStringtype(L, 2); // get this wxlCanObjAddScript * self = (wxlCanObjAddScript *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObjAddScript); *************** *** 347,351 **** wxlCanObjAddScript *returns; // const wxString script ! const wxString script = wxlua_getwxstringtype(L, 3); // double y double y = (double)wxlua_getnumbertype(L, 2); --- 347,351 ---- wxlCanObjAddScript *returns; // const wxString script ! const wxString script = wxlua_getwxStringtype(L, 3); // double y double y = (double)wxlua_getnumbertype(L, 2); |
From: John L. <jr...@us...> - 2007-12-07 06:45:15
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26745/wxLua/bindings Modified Files: genwxbind.lua 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: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** genwxbind.lua 7 Dec 2007 02:13:09 -0000 1.151 --- genwxbind.lua 7 Dec 2007 06:44:41 -0000 1.152 *************** *** 2841,2845 **** overload_argList = overload_argList.."&s_wxluaarg_String, " CommentBindingTable(codeList, " // get the string value\n") ! table.insert(codeList, " wxString val = wxlua_getwxstringtype(L, 2);\n") elseif not numeric and (not memberPtr or (memberPtr == "&")) then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(memberType)..", " --- 2841,2845 ---- overload_argList = overload_argList.."&s_wxluaarg_String, " CommentBindingTable(codeList, " // get the string value\n") ! table.insert(codeList, " wxString val = wxlua_getwxStringtype(L, 2);\n") elseif not numeric and (not memberPtr or (memberPtr == "&")) then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(memberType)..", " *************** *** 3208,3212 **** if (argType == "wxString") or (argType == "wxChar") then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxstringtype(L, "..argNum..")" -- Default String Value --- 3208,3212 ---- if (argType == "wxString") or (argType == "wxChar") then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxStringtype(L, "..argNum..")" -- Default String Value *************** *** 3271,3275 **** if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxstringtype(L, "..argNum..")" -- Default String Value --- 3271,3275 ---- if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxStringtype(L, "..argNum..")" -- Default String Value *************** *** 3301,3305 **** if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxstringtype(L, "..argNum..")" -- Default String Value --- 3301,3305 ---- if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxStringtype(L, "..argNum..")" -- Default String Value |
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26745/wxLua/modules/wxbind/src Modified Files: wxadv_adv.cpp wxadv_grid.cpp wxaui_aui.cpp wxbase_base.cpp wxbase_bind.cpp wxbase_config.cpp wxbase_data.cpp wxbase_datetime.cpp wxbase_file.cpp wxcore_appframe.cpp wxcore_bind.cpp wxcore_clipdrag.cpp wxcore_controls.cpp wxcore_core.cpp wxcore_defsutils.cpp wxcore_dialogs.cpp wxcore_event.cpp wxcore_gdi.cpp wxcore_help.cpp wxcore_image.cpp wxcore_mdi.cpp wxcore_menutool.cpp wxcore_picker.cpp wxcore_print.cpp wxcore_sizer.cpp wxcore_windows.cpp wxgl_gl.cpp wxhtml_html.cpp wxmedia_media.cpp wxnet_net.cpp wxstc_stc.cpp wxxml_xml.cpp wxxrc_xrc.cpp 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: wxnet_net.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxnet_net.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxnet_net.cpp 7 Dec 2007 02:13:14 -0000 1.4 --- wxnet_net.cpp 7 Dec 2007 06:44:46 -0000 1.5 *************** *** 1134,1138 **** bool returns; // const wxString hostname ! const wxString hostname = wxlua_getwxstringtype(L, 2); // get this wxIPaddress * self = (wxIPaddress *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxIPaddress); --- 1134,1138 ---- bool returns; // const wxString hostname ! const wxString hostname = wxlua_getwxStringtype(L, 2); // get this wxIPaddress * self = (wxIPaddress *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxIPaddress); *************** *** 1240,1244 **** bool returns; // const wxString service ! const wxString service = wxlua_getwxstringtype(L, 2); // get this wxIPaddress * self = (wxIPaddress *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxIPaddress); --- 1240,1244 ---- bool returns; // const wxString service ! const wxString service = wxlua_getwxStringtype(L, 2); // get this wxIPaddress * self = (wxIPaddress *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxIPaddress); *************** *** 1518,1522 **** wxInputStream *returns; // const wxString path ! const wxString path = wxlua_getwxstringtype(L, 2); // get this wxProtocol * self = (wxProtocol *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxProtocol); --- 1518,1522 ---- wxInputStream *returns; // const wxString path ! const wxString path = wxlua_getwxStringtype(L, 2); // get this wxProtocol * self = (wxProtocol *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxProtocol); *************** *** 1555,1559 **** { // const wxString user ! const wxString user = wxlua_getwxstringtype(L, 2); // get this wxProtocol * self = (wxProtocol *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxProtocol); --- 1555,1559 ---- { // const wxString user ! const wxString user = wxlua_getwxStringtype(L, 2); // get this wxProtocol * self = (wxProtocol *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxProtocol); *************** *** 1571,1575 **** { // const wxString user ! const wxString user = wxlua_getwxstringtype(L, 2); // get this wxProtocol * self = (wxProtocol *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxProtocol); --- 1571,1575 ---- { // const wxString user ! const wxString user = wxlua_getwxStringtype(L, 2); // get this wxProtocol * self = (wxProtocol *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxProtocol); *************** *** 1637,1641 **** wxString returns; // const wxString header ! const wxString header = wxlua_getwxstringtype(L, 2); // get this wxHTTP * self = (wxHTTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHTTP); --- 1637,1641 ---- wxString returns; // const wxString header ! const wxString header = wxlua_getwxStringtype(L, 2); // get this wxHTTP * self = (wxHTTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHTTP); *************** *** 1672,1678 **** { // const wxString h_data ! const wxString h_data = wxlua_getwxstringtype(L, 3); // const wxString header ! const wxString header = wxlua_getwxstringtype(L, 2); // get this wxHTTP * self = (wxHTTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHTTP); --- 1672,1678 ---- { // const wxString h_data ! const wxString h_data = wxlua_getwxStringtype(L, 3); // const wxString header ! const wxString header = wxlua_getwxStringtype(L, 2); // get this wxHTTP * self = (wxHTTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHTTP); *************** *** 1750,1754 **** bool returns; // const wxString dir ! const wxString dir = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1750,1754 ---- bool returns; // const wxString dir ! const wxString dir = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 1771,1775 **** char ret = (char)wxlua_getnumbertype(L, 3); // const wxString command ! const wxString command = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1771,1775 ---- char ret = (char)wxlua_getnumbertype(L, 3); // const wxString command ! const wxString command = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 1790,1794 **** bool returns; // const wxString filename ! const wxString filename = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1790,1794 ---- bool returns; // const wxString filename ! const wxString filename = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 1813,1817 **** int argCount = lua_gettop(L); // const wxString wildcard = "" ! const wxString wildcard = (argCount >= 3 ? wxlua_getwxstringtype(L, 3) : wxString(wxEmptyString)); // wxArrayString files wxArrayString * files = (wxArrayString *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxArrayString); --- 1813,1817 ---- int argCount = lua_gettop(L); // const wxString wildcard = "" ! const wxString wildcard = (argCount >= 3 ? wxlua_getwxStringtype(L, 3) : wxString(wxEmptyString)); // wxArrayString files wxArrayString * files = (wxArrayString *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxArrayString); *************** *** 1836,1840 **** int returns; // const wxString filename ! const wxString filename = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1836,1840 ---- int returns; // const wxString filename ! const wxString filename = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 1859,1863 **** int argCount = lua_gettop(L); // const wxString wildcard = "" ! const wxString wildcard = (argCount >= 3 ? wxlua_getwxstringtype(L, 3) : wxString(wxEmptyString)); // wxArrayString files wxArrayString * files = (wxArrayString *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxArrayString); --- 1859,1863 ---- int argCount = lua_gettop(L); // const wxString wildcard = "" ! const wxString wildcard = (argCount >= 3 ? wxlua_getwxStringtype(L, 3) : wxString(wxEmptyString)); // wxArrayString files wxArrayString * files = (wxArrayString *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxArrayString); *************** *** 1901,1905 **** wxOutputStream *returns; // const wxString file ! const wxString file = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1901,1905 ---- wxOutputStream *returns; // const wxString file ! const wxString file = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 1922,1926 **** bool returns; // const wxString dir ! const wxString dir = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1922,1926 ---- bool returns; // const wxString dir ! const wxString dir = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 1958,1964 **** bool returns; // const wxString dst ! const wxString dst = wxlua_getwxstringtype(L, 3); // const wxString src ! const wxString src = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1958,1964 ---- bool returns; // const wxString dst ! const wxString dst = wxlua_getwxStringtype(L, 3); // const wxString src ! const wxString src = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 1979,1983 **** bool returns; // const wxString dir ! const wxString dir = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1979,1983 ---- bool returns; // const wxString dir ! const wxString dir = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 1998,2002 **** bool returns; // const wxString path ! const wxString path = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 1998,2002 ---- bool returns; // const wxString path ! const wxString path = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 2017,2021 **** char returns; // const wxString command ! const wxString command = wxlua_getwxstringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); --- 2017,2021 ---- char returns; // const wxString command ! const wxString command = wxlua_getwxStringtype(L, 2); // get this wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); *************** *** 2235,2239 **** wxString returns; // const wxString uri ! const wxString uri = wxlua_getwxstringtype(L, 2); // get this wxURI * self = (wxURI *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxURI); --- 2235,2239 ---- wxString returns; // const wxString uri ! const wxString uri = wxlua_getwxStringtype(L, 2); // get this wxURI * self = (wxURI *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxURI); *************** *** 2580,2584 **** wxString returns; // const wxString szEscapedURI ! const wxString szEscapedURI = wxlua_getwxstringtype(L, 1); // call Unescape returns = (wxURI::Unescape(szEscapedURI)); --- 2580,2584 ---- wxString returns; // const wxString szEscapedURI ! const wxString szEscapedURI = wxlua_getwxStringtype(L, 1); // call Unescape returns = (wxURI::Unescape(szEscapedURI)); *************** *** 2672,2676 **** wxURI *returns; // const wxString uri ! const wxString uri = wxlua_getwxstringtype(L, 1); // call constructor returns = new wxURI(uri); --- 2672,2676 ---- wxURI *returns; // const wxString uri ! const wxString uri = wxlua_getwxStringtype(L, 1); // call constructor returns = new wxURI(uri); *************** *** 2856,2860 **** { // const wxString url_proxy ! const wxString url_proxy = wxlua_getwxstringtype(L, 1); // call SetDefaultProxy wxURL::SetDefaultProxy(url_proxy); --- 2856,2860 ---- { // const wxString url_proxy ! const wxString url_proxy = wxlua_getwxStringtype(L, 1); // call SetDefaultProxy wxURL::SetDefaultProxy(url_proxy); *************** *** 2870,2874 **** { // const wxString url_proxy ! const wxString url_proxy = wxlua_getwxstringtype(L, 2); // get this wxURL * self = (wxURL *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxURL); --- 2870,2874 ---- { // const wxString url_proxy ! const wxString url_proxy = wxlua_getwxStringtype(L, 2); // get this wxURL * self = (wxURL *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxURL); *************** *** 2929,2933 **** wxURL *returns; // const wxString sUrl ! const wxString sUrl = wxlua_getwxstringtype(L, 1); // call constructor returns = new wxURL(sUrl); --- 2929,2933 ---- wxURL *returns; // const wxString sUrl ! const wxString sUrl = wxlua_getwxStringtype(L, 1); // call constructor returns = new wxURL(sUrl); Index: wxstc_stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxstc_stc.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxstc_stc.cpp 7 Dec 2007 02:13:14 -0000 1.5 --- wxstc_stc.cpp 7 Dec 2007 06:44:46 -0000 1.6 *************** *** 50,54 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 50,54 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 98,102 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 98,102 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 346,350 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 346,350 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 426,430 **** { // const wxString characterSet ! const wxString characterSet = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 426,430 ---- { // const wxString characterSet ! const wxString characterSet = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 522,526 **** { // const wxString itemList ! const wxString itemList = wxlua_getwxstringtype(L, 3); // int lenEntered int lenEntered = (int)wxlua_getnumbertype(L, 2); --- 522,526 ---- { // const wxString itemList ! const wxString itemList = wxlua_getwxStringtype(L, 3); // int lenEntered int lenEntered = (int)wxlua_getnumbertype(L, 2); *************** *** 540,544 **** { // const wxString characterSet ! const wxString characterSet = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 540,544 ---- { // const wxString characterSet ! const wxString characterSet = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 755,759 **** { // const wxString definition ! const wxString definition = wxlua_getwxstringtype(L, 3); // int pos int pos = (int)wxlua_getnumbertype(L, 2); --- 755,759 ---- { // const wxString definition ! const wxString definition = wxlua_getwxStringtype(L, 3); // int pos int pos = (int)wxlua_getnumbertype(L, 2); *************** *** 1126,1130 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 3); // int length int length = (int)wxlua_getnumbertype(L, 2); --- 1126,1130 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 3); // int length int length = (int)wxlua_getnumbertype(L, 2); *************** *** 1448,1452 **** int flags = (argCount >= 5 ? (int)wxlua_getnumbertype(L, 5) : 0); // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 4); // int maxPos int maxPos = (int)wxlua_getnumbertype(L, 3); --- 1448,1452 ---- int flags = (argCount >= 5 ? (int)wxlua_getnumbertype(L, 5) : 0); // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 4); // int maxPos int maxPos = (int)wxlua_getnumbertype(L, 3); *************** *** 2625,2629 **** wxString returns; // const wxString key ! const wxString key = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 2625,2629 ---- wxString returns; // const wxString key ! const wxString key = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 2644,2648 **** wxString returns; // const wxString key ! const wxString key = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 2644,2648 ---- wxString returns; // const wxString key ! const wxString key = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 2663,2667 **** int returns; // const wxString key ! const wxString key = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 2663,2667 ---- int returns; // const wxString key ! const wxString key = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 3535,3539 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 3); // int pos int pos = (int)wxlua_getnumbertype(L, 2); --- 3535,3539 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 3); // int pos int pos = (int)wxlua_getnumbertype(L, 2); *************** *** 3955,3959 **** bool returns; // const wxString filename ! const wxString filename = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 3955,3959 ---- bool returns; // const wxString filename ! const wxString filename = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 4606,4610 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 4606,4610 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 4623,4627 **** int returns; // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 4623,4627 ---- int returns; // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 4642,4646 **** int returns; // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 4642,4646 ---- int returns; // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 4661,4665 **** bool returns; // const wxString filename ! const wxString filename = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 4661,4665 ---- bool returns; // const wxString filename ! const wxString filename = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 4726,4730 **** int returns; // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 4726,4730 ---- int returns; // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 4745,4749 **** int returns; // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 3); // int flags int flags = (int)wxlua_getnumbertype(L, 2); --- 4745,4749 ---- int returns; // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 3); // int flags int flags = (int)wxlua_getnumbertype(L, 2); *************** *** 4766,4770 **** int returns; // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 3); // int flags int flags = (int)wxlua_getnumbertype(L, 2); --- 4766,4770 ---- int returns; // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 3); // int flags int flags = (int)wxlua_getnumbertype(L, 2); *************** *** 5419,5423 **** { // const wxString keyWords ! const wxString keyWords = wxlua_getwxstringtype(L, 3); // int keywordSet int keywordSet = (int)wxlua_getnumbertype(L, 2); --- 5419,5423 ---- { // const wxString keyWords ! const wxString keyWords = wxlua_getwxStringtype(L, 3); // int keywordSet int keywordSet = (int)wxlua_getnumbertype(L, 2); *************** *** 5485,5489 **** { // const wxString language ! const wxString language = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 5485,5489 ---- { // const wxString language ! const wxString language = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 5787,5793 **** { // const wxString value ! const wxString value = wxlua_getwxstringtype(L, 3); // const wxString key ! const wxString key = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 5787,5793 ---- { // const wxString value ! const wxString value = wxlua_getwxStringtype(L, 3); // const wxString key ! const wxString key = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 6141,6145 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 6141,6145 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 6345,6349 **** { // const wxString characters ! const wxString characters = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 6345,6349 ---- { // const wxString characters ! const wxString characters = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 6383,6387 **** { // const wxString characters ! const wxString characters = wxlua_getwxstringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); --- 6383,6387 ---- { // const wxString characters ! const wxString characters = wxlua_getwxStringtype(L, 2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); *************** *** 6791,6795 **** { // const wxString fontName ! const wxString fontName = wxlua_getwxstringtype(L, 3); // int style int style = (int)wxlua_getnumbertype(L, 2); --- 6791,6795 ---- { // const wxString fontName ! const wxString fontName = wxlua_getwxStringtype(L, 3); // int style int style = (int)wxlua_getnumbertype(L, 2); *************** *** 6842,6846 **** bool bold = wxlua_getbooleantype(L, 5); // const wxString faceName ! const wxString faceName = wxlua_getwxstringtype(L, 4); // int size int size = (int)wxlua_getnumbertype(L, 3); --- 6842,6846 ---- bool bold = wxlua_getbooleantype(L, 5); // const wxString faceName ! const wxString faceName = wxlua_getwxStringtype(L, 4); // int size int size = (int)wxlua_getnumbertype(L, 3); *************** *** 6957,6961 **** { // const wxString spec ! const wxString spec = wxlua_getwxstringtype(L, 3); // int styleNum int styleNum = (int)wxlua_getnumbertype(L, 2); --- 6957,6961 ---- { // const wxString spec ! const wxString spec = wxlua_getwxStringtype(L, 3); // int styleNum int styleNum = (int)wxlua_getnumbertype(L, 2); *************** *** 7059,7063 **** int returns; // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 3); // int style int style = (int)wxlua_getnumbertype(L, 2); --- 7059,7063 ---- int returns; // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 3); // int style int style = (int)wxlua_getnumbertype(L, 2); *************** *** 7153,7157 **** { // const wxString itemList ! const wxString itemList = wxlua_getwxstringtype(L, 3); // int listType int listType = (int)wxlua_getnumbertype(L, 2); --- 7153,7157 ---- { // const wxString itemList ! const wxString itemList = wxlua_getwxStringtype(L, 3); // int listType int listType = (int)wxlua_getnumbertype(L, 2); *************** *** 7523,7527 **** int argCount = lua_gettop(L); // const wxString name = "wxStyledTextCtrl" ! const wxString name = (argCount >= 6 ? wxlua_getwxstringtype(L, 6) : wxString(wxT("wxStyledTextCtrl"))); // long style = 0 long style = (argCount >= 5 ? (long)wxlua_getnumbertype(L, 5) : 0); --- 7523,7527 ---- int argCount = lua_gettop(L); // const wxString name = "wxStyledTextCtrl" ! const wxString name = (argCount >= 6 ? wxlua_getwxStringtype(L, 6) : wxString(wxT("wxStyledTextCtrl"))); // long style = 0 long style = (argCount >= 5 ? (long)wxlua_getnumbertype(L, 5) : 0); *************** *** 8558,8562 **** { // const wxString val ! const wxString val = wxlua_getwxstringtype(L, 2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextEvent); --- 8558,8562 ---- { // const wxString val ! const wxString val = wxlua_getwxStringtype(L, 2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextEvent); *************** *** 8782,8786 **** { // const wxString t ! const wxString t = wxlua_getwxstringtype(L, 2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextEvent); --- 8782,8786 ---- { // const wxString t ! const wxString t = wxlua_getwxStringtype(L, 2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextEvent); Index: wxxrc_xrc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxrc_xrc.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxxrc_xrc.cpp 7 Dec 2007 02:13:14 -0000 1.4 --- wxxrc_xrc.cpp 7 Dec 2007 06:44:46 -0000 1.5 *************** *** 43,47 **** wxWindow * control = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); --- 43,47 ---- wxWindow * control = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); *************** *** 153,157 **** int value_if_not_found = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxID_NONE); // const wxString stringID ! const wxString stringID = wxlua_getwxstringtype(L, 1); // call GetXRCID returns = (wxXmlResource::GetXRCID(stringID, value_if_not_found)); --- 153,157 ---- int value_if_not_found = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxID_NONE); // const wxString stringID ! const wxString stringID = wxlua_getwxStringtype(L, 1); // call GetXRCID returns = (wxXmlResource::GetXRCID(stringID, value_if_not_found)); *************** *** 184,188 **** bool returns; // const wxString filemask ! const wxString filemask = wxlua_getwxstringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); --- 184,188 ---- bool returns; // const wxString filemask ! const wxString filemask = wxlua_getwxStringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); *************** *** 205,209 **** wxBitmap *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); --- 205,209 ---- wxBitmap *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); *************** *** 230,234 **** bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); --- 230,234 ---- bool returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 4); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); *************** *** 253,257 **** wxDialog *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); --- 253,257 ---- wxDialog *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 3); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); *************** *** 277,281 **** bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); --- 277,281 ---- bool returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 4); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); *************** *** 303,307 **** wxIcon *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); --- 303,307 ---- wxIcon *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); *************** *** 328,332 **** wxMenu *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); --- 328,332 ---- wxMenu *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); *************** *** 347,351 **** wxMenuBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); --- 347,351 ---- wxMenuBar *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); *************** *** 366,370 **** wxMenuBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); --- 366,370 ---- wxMenuBar *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 3); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); *************** *** 389,393 **** bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); --- 389,393 ---- bool returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 4); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); *************** *** 412,416 **** wxPanel *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); --- 412,416 ---- wxPanel *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 3); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); *************** *** 435,439 **** wxToolBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); --- 435,439 ---- wxToolBar *returns; // const wxString name ! const wxString name = wxlua_getwxStringtype(L, 3); // wxWindow parent wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); *************** *** 476,480 **** { // const wxString domain ! const wxString domain = wxlua_getwxstringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); --- 476,480 ---- { // const wxString domain ! const wxString domain = wxlua_getwxStringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); *************** *** 509,513 **** bool returns; // const wxString filename ! const wxString filename = wxlua_getwxstringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); --- 509,513 ---- bool returns; // const wxString filename ! const wxString filename = wxlua_getwxStringtype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); *************** *** 546,554 **** int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 3 ? wxlua_getwxstringtype(L, 3) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxXRC_USE_LOCALE); // const wxString filemask ! const wxString filemask = wxlua_getwxstringtype(L, 1); // call constructor returns = new wxXmlResource(filemask, flags, domain); --- 546,554 ---- int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 3 ? wxlua_getwxStringtype(L, 3) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxXRC_USE_LOCALE); // const wxString filemask ! const wxString filemask = wxlua_getwxStringtype(L, 1); // call constructor returns = new wxXmlResource(filemask, flags, domain); *************** *** 572,576 **** int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 2 ? wxlua_getwxstringtype(L, 2) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxXRC_USE_LOCALE); --- 572,576 ---- int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxXRC_USE_LOCALE); Index: wxcore_core.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_core.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxcore_core.cpp 7 Dec 2007 02:13:12 -0000 1.4 --- wxcore_core.cpp 7 Dec 2007 06:44:44 -0000 1.5 *************** *** 224,228 **** bool bShow = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : true); // const wxString szTitle ! const wxString szTitle = wxlua_getwxstringtype(L, 2); // wxWindow pParent wxWindow * pParent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); --- 224,228 ---- bool bShow = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : true); // const wxString szTitle ! const wxString szTitle = wxlua_getwxStringtype(L, 2); // wxWindow pParent wxWindow * pParent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); Index: wxcore_clipdrag.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_clipdrag.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxcore_clipdrag.cpp 7 Dec 2007 02:13:12 -0000 1.4 --- wxcore_clipdrag.cpp 7 Dec 2007 06:44:43 -0000 1.5 *************** *** 397,401 **** { // const wxString format ! const wxString format = wxlua_getwxstringtype(L, 2); // get this wxDataFormat * self = (wxDataFormat *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDataFormat); --- 397,401 ---- { // const wxString format ! const wxString format = wxlua_getwxStringtype(L, 2); // get this wxDataFormat * self = (wxDataFormat *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDataFormat); *************** *** 465,469 **** wxDataFormat *returns; // const wxString format ! const wxString format = wxlua_getwxstringtype(L, 1); // call constructor returns = new wxDataFormat(format); --- 465,469 ---- wxDataFormat *returns; // const wxString format ! const wxString format = wxlua_getwxStringtype(L, 1); // call constructor returns = new wxDataFormat(format); *************** *** 1038,1042 **** { // const wxString file ! const wxString file = wxlua_getwxstringtype(L, 2); // get this wxFileDataObject * self = (wxFileDataObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFileDataObject); --- 1038,1042 ---- { // const wxString file ! const wxString file = wxlua_getwxStringtype(L, 2); // get this wxFileDataObject * self = (wxFileDataObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFileDataObject); *************** *** 1174,1178 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxTextDataObject * self = (wxTextDataObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextDataObject); --- 1174,1178 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxTextDataObject * self = (wxTextDataObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextDataObject); *************** *** 1209,1213 **** int argCount = lua_gettop(L); // const wxString text = "" ! const wxString text = (argCount >= 1 ? wxlua_getwxstringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxTextDataObject(text); --- 1209,1213 ---- int argCount = lua_gettop(L); // const wxString text = "" ! const wxString text = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxTextDataObject(text); *************** *** 1382,1386 **** { // const wxString url ! const wxString url = wxlua_getwxstringtype(L, 2); // get this wxURLDataObject * self = (wxURLDataObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxURLDataObject); --- 1382,1386 ---- { // const wxString url ! const wxString url = wxlua_getwxStringtype(L, 2); // get this wxURLDataObject * self = (wxURLDataObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxURLDataObject); *************** *** 1417,1421 **** int argCount = lua_gettop(L); // const wxString url = "" ! const wxString url = (argCount >= 1 ? wxlua_getwxstringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxURLDataObject(url); --- 1417,1421 ---- int argCount = lua_gettop(L); // const wxString url = "" ! const wxString url = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxURLDataObject(url); *************** *** 1992,1996 **** int argCount = lua_gettop(L); // const wxString filename = "" ! const wxString filename = (argCount >= 1 ? wxlua_getwxstringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxMetafile(filename); --- 1992,1996 ---- int argCount = lua_gettop(L); // const wxString filename = "" ! const wxString filename = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxMetafile(filename); *************** *** 2081,2085 **** int argCount = lua_gettop(L); // const wxString filename = "" ! const wxString filename = (argCount >= 1 ? wxlua_getwxstringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxMetafileDC(filename); --- 2081,2085 ---- int argCount = lua_gettop(L); // const wxString filename = "" ! const wxString filename = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxEmptyString)); // call constructor returns = new wxMetafileDC(filename); Index: wxcore_help.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_help.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxcore_help.cpp 7 Dec 2007 02:13:12 -0000 1.4 --- wxcore_help.cpp 7 Dec 2007 06:44:44 -0000 1.5 *************** *** 200,204 **** { // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 3); // wxWindow window wxWindow * window = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); --- 200,204 ---- { // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 3); // wxWindow window wxWindow * window = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); *************** *** 589,593 **** bool returns; // const wxString section ! const wxString section = wxlua_getwxstringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); --- 589,593 ---- bool returns; // const wxString section ! const wxString section = wxlua_getwxStringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); *************** *** 631,635 **** const wxPoint * pos = (const wxPoint *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxPoint); // const wxString text ! const wxString text = wxlua_getwxstringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); --- 631,635 ---- const wxPoint * pos = (const wxPoint *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxPoint); // const wxString text ! const wxString text = wxlua_getwxStringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); *************** *** 701,705 **** { // const wxString file ! const wxString file = wxlua_getwxstringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); --- 701,705 ---- { // const wxString file ! const wxString file = wxlua_getwxStringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); *************** *** 722,726 **** wxHelpSearchMode mode = (argCount >= 3 ? (wxHelpSearchMode)wxlua_getintegertype(L, 3) : wxHELP_SEARCH_ALL); // const wxString keyWord ! const wxString keyWord = wxlua_getwxstringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); --- 722,726 ---- wxHelpSearchMode mode = (argCount >= 3 ? (wxHelpSearchMode)wxlua_getintegertype(L, 3) : wxHELP_SEARCH_ALL); // const wxString keyWord ! const wxString keyWord = wxlua_getwxStringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); *************** *** 743,747 **** int argCount = lua_gettop(L); // const wxString file = "" ! const wxString file = (argCount >= 2 ? wxlua_getwxstringtype(L, 2) : wxString(wxEmptyString)); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); --- 743,747 ---- int argCount = lua_gettop(L); // const wxString file = "" ! const wxString file = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); *************** *** 788,792 **** const wxSize * size = (const wxSize *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxSize); // const wxString title ! const wxString title = wxlua_getwxstringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); --- 788,792 ---- const wxSize * size = (const wxSize *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxSize); // const wxString title ! const wxString title = wxlua_getwxStringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); *************** *** 827,831 **** long flags = (long)wxlua_getnumbertype(L, 3); // const wxString viewer ! const wxString viewer = wxlua_getwxstringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); --- 827,831 ---- long flags = (long)wxlua_getnumbertype(L, 3); // const wxString viewer ! const wxString viewer = wxlua_getwxStringtype(L, 2); // get this wxHelpControllerBase * self = (wxHelpControllerBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHelpControllerBase); Index: wxcore_gdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_gdi.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxcore_gdi.cpp 7 Dec 2007 02:13:12 -0000 1.6 --- wxcore_gdi.cpp 7 Dec 2007 06:44:44 -0000 1.7 *************** *** 3686,3690 **** wxFontEncoding encoding = (argCount >= 5 ? (wxFontEncoding)wxlua_getintegertype(L, 5) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 4 ? wxlua_getwxstringtype(L, 4) : wxString(wxEmptyString)); // int flags = wxFONTFLAG_DEFAULT int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxFONTFLAG_DEFAULT); --- 3686,3690 ---- wxFontEncoding encoding = (argCount >= 5 ? (wxFontEncoding)wxlua_getintegertype(L, 5) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 4 ? wxlua_getwxStringtype(L, 4) : wxString(wxEmptyString)); // int flags = wxFONTFLAG_DEFAULT int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxFONTFLAG_DEFAULT); *************** *** 3714,3718 **** wxFontEncoding encoding = (argCount >= 7 ? (wxFontEncoding)wxlua_getintegertype(L, 7) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 6 ? wxlua_getwxstringtype(L, 6) : wxString(wxEmptyString)); // const bool underline = false const bool underline = (argCount >= 5 ? wxlua_getbooleantype(L, 5) : false); --- 3714,3718 ---- wxFontEncoding encoding = (argCount >= 7 ? (wxFontEncoding)wxlua_getintegertype(L, 7) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 6 ? wxlua_getwxStringtype(L, 6) : wxString(wxEmptyString)); // const bool underline = false const bool underline = (argCount >= 5 ? wxlua_getbooleantype(L, 5) : false); *************** *** 3749,3753 **** wxFontEncoding encoding = (argCount >= 5 ? (wxFontEncoding)wxlua_getintegertype(L, 5) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 4 ? wxlua_getwxstringtype(L, 4) : wxString(wxEmptyString)); // int flags = wxFONTFLAG_DEFAULT int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxFONTFLAG_DEFAULT); --- 3749,3753 ---- wxFontEncoding encoding = (argCount >= 5 ? (wxFontEncoding)wxlua_getintegertype(L, 5) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 4 ? wxlua_getwxStringtype(L, 4) : wxString(wxEmptyString)); // int flags = wxFONTFLAG_DEFAULT int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxFONTFLAG_DEFAULT); *************** *** 3777,3781 **** wxFontEncoding encoding = (argCount >= 7 ? (wxFontEncoding)wxlua_getintegertype(L, 7) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 6 ? wxlua_getwxstringtype(L, 6) : wxString(wxEmptyString)); // const bool underline = false const bool underline = (argCount >= 5 ? wxlua_getbooleantype(L, 5) : false); --- 3777,3781 ---- wxFontEncoding encoding = (argCount >= 7 ? (wxFontEncoding)wxlua_getintegertype(L, 7) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 6 ? wxlua_getwxStringtype(L, 6) : wxString(wxEmptyString)); // const bool underline = false const bool underline = (argCount >= 5 ? wxlua_getbooleantype(L, 5) : false); *************** *** 3843,3847 **** bool returns; // const wxString faceName ! const wxString faceName = wxlua_getwxstringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); --- 3843,3847 ---- bool returns; // const wxString faceName ! const wxString faceName = wxlua_getwxStringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); *************** *** 3864,3868 **** { // const wxString faceName ! const wxString faceName = wxlua_getwxstringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); --- 3864,3868 ---- { // const wxString faceName ! const wxString faceName = wxlua_getwxStringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); *************** *** 3901,3905 **** bool returns; // const wxString info ! const wxString info = wxlua_getwxstringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); --- 3901,3905 ---- bool returns; // const wxString info ! const wxString info = wxlua_getwxStringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); *************** *** 3922,3926 **** { // const wxString info ! const wxString info = wxlua_getwxstringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); --- 3922,3926 ---- { // const wxString info ! const wxString info = wxlua_getwxStringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); *************** *** 3942,3946 **** bool returns; // const wxString info ! const wxString info = wxlua_getwxstringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); --- 3942,3946 ---- bool returns; // const wxString info ! const wxString info = wxlua_getwxStringtype(L, 2); // get this wxFont * self = (wxFont *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFont); *************** *** 4108,4112 **** wxFontEncoding encoding = (argCount >= 7 ? (wxFontEncoding)wxlua_getintegertype(L, 7) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 6 ? wxlua_getwxstringtype(L, 6) : wxString(wxEmptyString)); // const bool underline = false const bool underline = (argCount >= 5 ? wxlua_getbooleantype(L, 5) : false); --- 4108,4112 ---- wxFontEncoding encoding = (argCount >= 7 ? (wxFontEncoding)wxlua_getintegertype(L, 7) : wxFONTENCODING_DEFAULT); // const wxString faceName = "" ! const wxString faceName = (argCount >= 6 ? wxlua_getwxStringtype(L, 6) : wxString(wxEmptyString)); // const bool underline = false const bool underline = (argCount >= 5 ? wxlua_getbooleantype(L, 5) : false); *************** *** 4265,4269 **** bool returns; // const wxString s ! const wxString s = wxlua_getwxstringtype(L, 2); // get this wxNativeFontInfo * self = (wxNativeFontInfo *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxNativeFontInfo); --- 4265,4269 ---- bool returns; // const wxString s ! const wxString s = wxlua_getwxStringtype(L, 2); // get this wxNativeFontInfo * self = (wxNativeFontInfo *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxNativeFontInfo); *************** *** 4284,4288 **** bool returns; // const wxString s ! const wxString s = wxlua_getwxstringtype(L, 2); // get this wxNativeFontInfo * self = (wxNativeFontInfo *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxNativeFontInfo); --- 4284,4288 ---- bool returns; // const wxString s ! const wxString s = wxlua_getwxStringtype(L, 2); // get this wxNativeFontInfo * self = (wxNativeFontInfo *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxNativeFontInfo); *************** *** 4489,4493 **** { // const wxString facename ! const wxString facename = wxlua_getwxstringtype(L, 2); // get this wxNativeFontInfo * self = (wxNativeFontInfo *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxNativeFontInfo); --- 4489,4493 ---- { // const wxString facename ! const wxString facename = wxlua_getwxStringtype(L, 2); // get this wxNativeFontInfo * self = (wxNativeFontInfo *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxNativeFontInfo); *************** *** 4509,4513 **** bool returns; // const wxString facename ! const wxString facename = wxlua_getwxstringtype(L, 2); // get this wxNativeFontInfo * self = (wxNativeFontInfo *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxNativeFontInfo); --- 4509,4513 ---- bool returns; // const wxString facename ! const wxString facename = wxlua_getwxStringtype(L, 2); // get this ... [truncated message content] |
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; |
From: John L. <jr...@us...> - 2007-12-07 06:44:52
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26745/wxLua/modules/wxluasocket/src Modified Files: wxluasocket.cpp 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: wxluasocket.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wxluasocket.cpp 7 Dec 2007 02:13:14 -0000 1.32 --- wxluasocket.cpp 7 Dec 2007 06:44:47 -0000 1.33 *************** *** 37,41 **** int lineNumber = (int)wxlua_getnumbertype(L, 3); // const wxString fileName ! const wxString fileName = wxlua_getwxstringtype(L, 2); // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); --- 37,41 ---- int lineNumber = (int)wxlua_getnumbertype(L, 3); // const wxString fileName ! const wxString fileName = wxlua_getwxStringtype(L, 2); // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); *************** *** 127,131 **** bool returns; // const wxString expr ! const wxString expr = wxlua_getwxstringtype(L, 3); // int exprRef int exprRef = (int)wxlua_getnumbertype(L, 2); --- 127,131 ---- bool returns; // const wxString expr ! const wxString expr = wxlua_getwxStringtype(L, 3); // int exprRef int exprRef = (int)wxlua_getnumbertype(L, 2); *************** *** 212,216 **** int lineNumber = (int)wxlua_getnumbertype(L, 3); // const wxString fileName ! const wxString fileName = wxlua_getwxstringtype(L, 2); // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); --- 212,216 ---- int lineNumber = (int)wxlua_getnumbertype(L, 3); // const wxString fileName ! const wxString fileName = wxlua_getwxStringtype(L, 2); // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); *************** *** 248,254 **** bool returns; // const wxString fileName ! const wxString fileName = wxlua_getwxstringtype(L, 3); // const wxString file ! const wxString file = wxlua_getwxstringtype(L, 2); // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); --- 248,254 ---- bool returns; // const wxString fileName ! const wxString fileName = wxlua_getwxStringtype(L, 3); // const wxString file ! const wxString file = wxlua_getwxStringtype(L, 2); // get this wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaDebuggerServer); |
From: John L. <jr...@us...> - 2007-12-07 06:44:52
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26745/wxLua/modules/wxlua/src Modified Files: wxlcallb.cpp wxlstate.cpp wxlua.cpp wxlua_bind.cpp 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: wxlua.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxlua.cpp 7 Dec 2007 02:13:14 -0000 1.5 --- wxlua.cpp 7 Dec 2007 06:44:47 -0000 1.6 *************** *** 90,96 **** static int LUACALL wxLua_wxLuaObject_GetObject(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxLuaObject *self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call GetObject that push the item onto the stack, or nil if (self->GetObject()) --- 90,95 ---- static int LUACALL wxLua_wxLuaObject_GetObject(lua_State *L) { // get this ! wxLuaObject *self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); // call GetObject that push the item onto the stack, or nil if (self->GetObject()) *************** *** 108,114 **** static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxLuaObject *self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call SetObject self->SetObject(1); --- 107,112 ---- static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L) { // get this ! wxLuaObject *self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); // call SetObject self->SetObject(1); *************** *** 141,151 **** wxluabind_removetableforcall(L); wxLuaState wxlState(L); wxLuaObject *returns; // call constructor returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); // return the number of parameters return 1; --- 139,150 ---- wxluabind_removetableforcall(L); wxLuaState wxlState(L); + wxLuaObject *returns; // call constructor 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); // return the number of parameters return 1; Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** wxlstate.cpp 7 Dec 2007 02:24:56 -0000 1.146 --- wxlstate.cpp 7 Dec 2007 06:44:46 -0000 1.147 *************** *** 987,991 **** } ! wxString LUACALL wxlua_getwxstringtype(lua_State *L, int stack_idx) { if (wxlua_isstringtype(L, stack_idx)) --- 987,991 ---- } ! wxString LUACALL wxlua_getwxStringtype(lua_State *L, int stack_idx) { if (wxlua_isstringtype(L, stack_idx)) *************** *** 1156,1160 **** else if (wxlua_iswxstringtype(L, -1)) { ! ((wxArrayString&)arr).Add(wxlua_getwxstringtype(L, -1)); ++count; --- 1156,1160 ---- else if (wxlua_iswxstringtype(L, -1)) { ! ((wxArrayString&)arr).Add(wxlua_getwxStringtype(L, -1)); ++count; *************** *** 1845,1852 **** { // value = -1, key = -2, table = -3 ! wxLuaCallback* cb = (wxLuaCallback*)lua_touserdata(L, -1); ! wxCHECK_RET(cb, wxT("Invalid wxLuaCallback")); ! if (cb && (cb->GetwxLuaState().GetRefData() != this)) // don't unref us ! cb->ClearwxLuaState(); lua_pop(L, 1); // pop value, lua_next will pop key at end --- 1845,1850 ---- { // value = -1, key = -2, table = -3 ! wxLuaCallback* cb = (wxLuaCallback*)lua_touserdata(L, -2); ! cb->ClearwxLuaState(); lua_pop(L, 1); // pop value, lua_next will pop key at end *************** *** 1860,1863 **** --- 1858,1862 ---- // ---------------------------------------------------------------------- + // These should already be gone from wxLuaCleanupWindows, make sure... lua_pushlightuserdata(L, &wxlua_lreg_windestroycallbacks_key); // push key *************** *** 1868,1877 **** { // value = -1, key = -2, table = -3 ! if (lua_type(L, -2) == LUA_TNUMBER) { ! wxLuaWinDestroyCallback* cb = (wxLuaWinDestroyCallback*)lua_touserdata(L, -1); ! wxCHECK_RET(cb, wxT("Invalid wxLuaWinDestroyCallback")); ! if (cb && (cb->GetwxLuaState().GetRefData() != this)) // don't unref us ! cb->ClearwxLuaState(); } --- 1867,1874 ---- { // value = -1, key = -2, table = -3 ! if (lua_type(L, -1) == LUA_TNUMBER) { ! wxLuaWinDestroyCallback* cb = (wxLuaWinDestroyCallback*)lua_touserdata(L, -2); ! cb->ClearwxLuaState(); } *************** *** 1892,1896 **** if (it != s_wxHashMapLuaState.end()) { - //wxPrintf(wxT("GetLuaStateRefData L %d data %d\n"), (int)L, (int)it->second); return wxLuaState(*it->second); } --- 1889,1892 ---- *************** *** 2099,2104 **** if (m_refData == NULL) return; - //wxPrintf(wxT("wxLuaState::Destroy RefCount %d\n"), GetRefData()->GetRefCount()); - // we don't want recursion in UnRef and wxlua_garbageCollect if (GetRefData()->GetRefCount() == 1) --- 2095,2098 ---- *************** *** 2783,2786 **** --- 2777,2783 ---- lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (table) + // Note: We push t[callback] = 1 so that we can determine later + // what datatypes the key and values are. + lua_pushlightuserdata(L, callback); // push key lua_pushnumber(L, 1); // push value *************** *** 2939,2943 **** { wxCHECK_MSG(Ok(), wxEmptyString, wxT("Invalid wxLuaState")); ! return wxlua_getwxstringtype(M_WXLSTATEDATA->m_lua_State, stack_idx); } bool wxLuaState::GetBooleanType(int stack_idx) --- 2936,2940 ---- { wxCHECK_MSG(Ok(), wxEmptyString, wxT("Invalid wxLuaState")); ! return wxlua_getwxStringtype(M_WXLSTATEDATA->m_lua_State, stack_idx); } bool wxLuaState::GetBooleanType(int stack_idx) Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wxlcallb.cpp 7 Dec 2007 02:13:14 -0000 1.47 --- wxlcallb.cpp 7 Dec 2007 06:44:46 -0000 1.48 *************** *** 70,77 **** } wxString wxLuaCallback::GetInfo() const { ! return wxString::Format(wxT("%s(%d) -> wxLuaCallback(%p, ids %d, %d)|wxEvtHandler(%p) -> %s"), ! lua2wx(m_wxlBindEvent ? m_wxlBindEvent->name : "?").c_str(), (int)GetEventType(), this, m_id, m_last_id, m_evtHandler, m_evtHandler->GetClassInfo()->GetClassName()); --- 70,82 ---- } + void wxLuaCallback::ClearwxLuaState() + { + m_wxlState.UnRef(); + } + wxString wxLuaCallback::GetInfo() const { ! return wxString::Format(wxT("%s(%d) -> wxLuaCallback(%p, ids %d, %d)|wxEvtHandler(%p) -> %s"), ! lua2wx(m_wxlBindEvent ? m_wxlBindEvent->name : "?").c_str(), (int)GetEventType(), this, m_id, m_last_id, m_evtHandler, m_evtHandler->GetClassInfo()->GetClassName()); *************** *** 184,187 **** --- 189,197 ---- } + void wxLuaWinDestroyCallback::ClearwxLuaState() + { + m_wxlState.UnRef(); + } + wxString wxLuaWinDestroyCallback::GetInfo() const { *************** *** 190,195 **** winName = m_window->GetClassInfo()->GetClassName(); ! return wxString::Format(wxT("%s(%p, id=%d)|wxLuaDestroyCallback(%p)"), ! winName.c_str(), m_window, m_window ? m_window->GetId() : -1, this); } --- 200,205 ---- winName = m_window->GetClassInfo()->GetClassName(); ! return wxString::Format(wxT("%s(%p, id=%d)|wxLuaDestroyCallback(%p)"), ! winName.c_str(), m_window, m_window ? m_window->GetId() : -1, this); } *************** *** 240,247 **** { // value = -1, key = -2, table = -3 ! wxLuaCallback* wxlCallback = (wxLuaCallback*)lua_touserdata(L, -1); wxCHECK_RET(wxlCallback, wxT("Invalid wxLuaCallback")); ! if (wxlCallback->GetEvtHandler() == evtHandler) { // remove the ref to the routine since we're clearing the wxLuaState --- 250,258 ---- { // value = -1, key = -2, table = -3 ! wxLuaCallback* wxlCallback = (wxLuaCallback*)lua_touserdata(L, -2); wxCHECK_RET(wxlCallback, wxT("Invalid wxLuaCallback")); ! if ((wxlCallback->GetEvtHandler() == evtHandler) || ! (wxlCallback->GetEvtHandler() == (wxEvtHandler*)m_window)) { // remove the ref to the routine since we're clearing the wxLuaState Index: wxlua_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua_bind.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wxlua_bind.cpp 7 Dec 2007 02:13:14 -0000 1.13 --- wxlua_bind.cpp 7 Dec 2007 06:44:47 -0000 1.14 *************** *** 136,145 **** static int LUACALL wxLua_function_CompileLuaScript(lua_State *L) { - wxLuaState wxlState(L); int returns; // const wxString fileName ! const wxString fileName = wxlState.GetwxStringType(2); // const wxString luaScript ! const wxString luaScript = wxlState.GetwxStringType(1); wxString errMsg; int line_num = -1; --- 136,144 ---- static int LUACALL wxLua_function_CompileLuaScript(lua_State *L) { int returns; // const wxString fileName ! const wxString fileName = wxlua_getwxStringtype(L, 2); // const wxString luaScript ! const wxString luaScript = wxlua_getwxStringtype(L, 1); wxString errMsg; int line_num = -1; *************** *** 148,152 **** // push the result number lua_pushnumber(L, returns); ! wxlState.lua_PushString(errMsg); lua_pushnumber(L, line_num); return 3; --- 147,151 ---- // push the result number lua_pushnumber(L, returns); ! wxlua_pushwxString(L, errMsg); lua_pushnumber(L, line_num); return 3; *************** *** 199,205 **** int LUACALL wxluabind_wxLuaBindCFunc__index(lua_State* L) { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - void **ptr = (void **)lua_touserdata(L, 1); wxLuaBindCFunc* wxlCFunc= (wxLuaBindCFunc*)*ptr; --- 198,201 ---- *************** *** 283,289 **** int LUACALL wxluabind_wxLuaBindMethod__index(lua_State* L) { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - void **ptr = (void **)lua_touserdata(L, 1); wxLuaBindMethod* wxlMethod = (wxLuaBindMethod*)*ptr; --- 279,282 ---- *************** *** 388,394 **** int LUACALL wxluabind_wxLuaBindClass__index(lua_State* L) { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - void **ptr = (void **)lua_touserdata(L, 1); wxLuaBindClass* wxlClass = (wxLuaBindClass*)*ptr; --- 381,384 ---- *************** *** 450,457 **** if (wxlClass->classInfo) { ! const wxLuaBindClass* classInfoClass = wxlState.GetBindClass("wxClassInfo"); if (classInfoClass) { ! wxlState.PushUserDataType(*classInfoClass->class_tag, wxlClass->classInfo); return 1; } --- 440,447 ---- if (wxlClass->classInfo) { ! const wxLuaBindClass* classInfoClass = wxluaT_getclass(L, "wxClassInfo"); if (classInfoClass) { ! wxluaT_pushuserdatatype(L, *classInfoClass->class_tag, wxlClass->classInfo); return 1; } *************** *** 535,541 **** int LUACALL wxluabind_wxLuaBinding__index(lua_State* L) { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - void **ptr = (void **)lua_touserdata(L, 1); wxLuaBinding* wxlBinding = (wxLuaBinding*)*ptr; --- 525,528 ---- *************** *** 718,724 **** lua_pushstring(L, "object"); if (wxlObject->objPtr != 0) ! wxlState.wxluaT_PushUserTag(wxlObject->objPtr, *wxlObject->class_tag, false); else ! wxlState.wxluaT_PushUserTag(*wxlObject->pObjPtr, *wxlObject->class_tag, false); lua_rawset(L, -3); --- 705,711 ---- lua_pushstring(L, "object"); if (wxlObject->objPtr != 0) ! wxluaT_pushusertag(L, wxlObject->objPtr, *wxlObject->class_tag, false); else ! wxluaT_pushusertag(L, *wxlObject->pObjPtr, *wxlObject->class_tag, false); lua_rawset(L, -3); *************** *** 807,812 **** static int LUACALL wxLua_function_type(lua_State *L) { - wxLuaState wxlState(L); - int ltype = lua_type(L, 1); const char* ltypename = lua_typename(L, ltype); --- 794,797 ---- *************** *** 822,826 **** wxluaarg_tag = wxlua_getwxluatype(ltype); ! wxString tagName = wxlState.GetLuaTagName(wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the results --- 807,811 ---- wxluaarg_tag = wxlua_getwxluatype(ltype); ! wxString tagName = wxluaT_gettagname(L, wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the results *************** *** 841,852 **** static int LUACALL wxLua_function_typename(lua_State *L) { - wxLuaState wxlState(L); wxString returns; // int wxluaarg_tag int wxluaarg_tag = (int)wxlua_getnumbertype(L, 1); // call wxlua_getwxluatypename ! returns = wxlState.GetLuaTagName(wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the result string ! wxlState.lua_PushString(returns); return 1; --- 826,836 ---- static int LUACALL wxLua_function_typename(lua_State *L) { wxString returns; // int wxluaarg_tag int wxluaarg_tag = (int)wxlua_getnumbertype(L, 1); // call wxlua_getwxluatypename ! returns = wxluaT_gettagname(L, wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the result string ! wxlua_pushwxString(L, returns); return 1; |
From: John L. <jr...@us...> - 2007-12-07 02:24:59
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18014/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlstate.cpp Log Message: Unicode fixes Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** wxlstate.cpp 7 Dec 2007 02:13:14 -0000 1.145 --- wxlstate.cpp 7 Dec 2007 02:24:56 -0000 1.146 *************** *** 344,348 **** lua_rawget(L, -2); // get t[key] = value; pop key push value ! if (lua_isnumber(L, -1)) tag = (int)lua_tonumber(L, -1); --- 344,348 ---- lua_rawget(L, -2); // get t[key] = value; pop key push value ! if (lua_isnumber(L, -1)) tag = (int)lua_tonumber(L, -1); *************** *** 587,592 **** } lua_pop(L, 1); // pop nil ! ! // Then add it lua_pushlightuserdata(L, (void*)obj_ptr); // push key lua_pushlightuserdata(L, wxobj); // push value --- 587,592 ---- } lua_pop(L, 1); // pop nil ! ! // Then add it lua_pushlightuserdata(L, (void*)obj_ptr); // push key lua_pushlightuserdata(L, wxobj); // push value *************** *** 611,615 **** lua_pushnil(L); // push value lua_rawset(L, -3); // set t[key] = nil; pops key and value ! lua_pop(L, 1); // pop objects table } --- 611,615 ---- lua_pushnil(L); // push value lua_rawset(L, -3); // set t[key] = nil; pops key and value ! lua_pop(L, 1); // pop objects table } *************** *** 629,633 **** } ! lua_pop(L, 1); // pop lightuserdata lua_pushlightuserdata(L, obj_ptr); // push key --- 629,633 ---- } ! lua_pop(L, 1); // pop lightuserdata lua_pushlightuserdata(L, obj_ptr); // push key *************** *** 682,686 **** void LUACALL wxluaW_addtrackedwindow(lua_State *L, wxObject* obj) { ! if (!obj) false; // allow NULL w/o error // don't track these "windows" since they're supposed to be attached --- 682,686 ---- void LUACALL wxluaW_addtrackedwindow(lua_State *L, wxObject* obj) { ! if (!obj) return; // allow NULL w/o error // don't track these "windows" since they're supposed to be attached *************** *** 732,736 **** if (lua_isnumber(L, -1)) { ! lua_pop(L, 2); // pop topwindows table and value return true; } --- 732,736 ---- if (lua_isnumber(L, -1)) { ! lua_pop(L, 2); // pop topwindows table and value return true; } *************** *** 1172,1176 **** else if (wxlua_iswxuserdata(L, stack_idx)) { ! int arrstr_tag = wxluaT_gettag(L, wxT("wxArrayString")); if (wxlua_isuserdatatype(L, stack_idx, arrstr_tag)) --- 1172,1176 ---- else if (wxlua_iswxuserdata(L, stack_idx)) { ! int arrstr_tag = wxluaT_gettag(L, "wxArrayString"); if (wxlua_isuserdatatype(L, stack_idx, arrstr_tag)) *************** *** 1208,1212 **** else if (wxlua_iswxuserdata(L, stack_idx)) { ! int arrstr_tag = wxluaT_gettag(L, wxT("wxArrayString")); if (wxlua_isuserdatatype(L, stack_idx, arrstr_tag)) --- 1208,1212 ---- else if (wxlua_iswxuserdata(L, stack_idx)) { ! int arrstr_tag = wxluaT_gettag(L, "wxArrayString"); if (wxlua_isuserdatatype(L, stack_idx, arrstr_tag)) *************** *** 1267,1271 **** else if (wxlua_iswxuserdata(L, stack_idx)) { ! int arrint_tag = wxluaT_gettag(L, wxT("wxArrayInt")); if (wxlua_isuserdatatype(L, stack_idx, arrint_tag)) --- 1267,1271 ---- else if (wxlua_iswxuserdata(L, stack_idx)) { ! int arrint_tag = wxluaT_gettag(L, "wxArrayInt"); if (wxlua_isuserdatatype(L, stack_idx, arrint_tag)) *************** *** 1450,1454 **** //---------------------------------------------------------------------------- ! // Other functions for wxLua's keys in the //---------------------------------------------------------------------------- --- 1450,1454 ---- //---------------------------------------------------------------------------- ! // Other functions for wxLua's keys in the //---------------------------------------------------------------------------- *************** *** 1628,1637 **** lua_pushnil(L); lua_rawset(L, -3); // set t[key] = nil to remove it ! try_again = true; break; } ! else lua_pop(L, 1); // pop value, lua_next will pop key at end } --- 1628,1637 ---- lua_pushnil(L); lua_rawset(L, -3); // set t[key] = nil to remove it ! try_again = true; break; } ! else lua_pop(L, 1); // pop value, lua_next will pop key at end } *************** *** 1639,1643 **** lua_pop(L, 1); // pop table ! return removed; } --- 1639,1643 ---- lua_pop(L, 1); // pop table ! return removed; } *************** *** 1655,1659 **** { // we add "new" copies of the bindings, let the list delete them ! m_bindingList.DeleteContents(true); wxLuaBindingList::compatibility_iterator node = wxLuaBinding::GetBindingList()->GetFirst(); --- 1655,1659 ---- { // we add "new" copies of the bindings, let the list delete them ! m_bindingList.DeleteContents(true); wxLuaBindingList::compatibility_iterator node = wxLuaBinding::GetBindingList()->GetFirst(); *************** *** 1773,1777 **** // Let the Lua garbage collector do it for shutdown. ! // Delete all the wxObject data lua_pushlightuserdata(m_lua_State, &wxlua_lreg_delobjects_key); lua_rawget(m_lua_State, LUA_REGISTRYINDEX); --- 1773,1777 ---- // Let the Lua garbage collector do it for shutdown. ! // Delete all the wxObject data lua_pushlightuserdata(m_lua_State, &wxlua_lreg_delobjects_key); lua_rawget(m_lua_State, LUA_REGISTRYINDEX); *************** *** 2650,2654 **** if (obj && obj->GetClassInfo() && obj->GetClassInfo()->GetClassName()) name = obj->GetClassInfo()->GetClassName(); ! names.Add(wxString::Format(wxT("%s %p"), name.c_str(), obj)); --- 2650,2654 ---- if (obj && obj->GetClassInfo() && obj->GetClassInfo()->GetClassName()) name = obj->GetClassInfo()->GetClassName(); ! names.Add(wxString::Format(wxT("%s %p"), name.c_str(), obj)); Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** wxlbind.cpp 7 Dec 2007 02:13:14 -0000 1.100 --- wxlbind.cpp 7 Dec 2007 02:24:56 -0000 1.101 *************** *** 206,210 **** if (ltype != LUA_TUSERDATA) { ! fnCall += lua_typename(L, ltype); } else --- 206,210 ---- if (ltype != LUA_TUSERDATA) { ! fnCall += lua2wx(lua_typename(L, ltype)); } else |
From: John L. <jr...@us...> - 2007-12-07 02:13:45
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12976/wxLua/modules/wxbind/include Modified Files: wxadv_bind.h wxaui_bind.h wxbase_bind.h wxcore_bind.h wxgl_bind.h wxhtml_bind.h wxmedia_bind.h wxnet_bind.h wxrichtext_bind.h wxstc_bind.h wxxml_bind.h wxxrc_bind.h Log Message: Too many changes to list... A large portion of the internal workings of the wxLuaState have been rewritten. All of the data that was stored in wxLuaStateData that might be needed by a function taking a lua_State* is now in the LUA_REGISTRYINDEX. C functions have been added to access these values. The generated bindings no longer need to have "wxLuaState wxlState(L);" since everything can be done with the C functions. The result is that wxLua should be faster. Index: wxadv_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxadv_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxadv_bind.h 17 Nov 2007 00:14:55 -0000 1.5 --- wxadv_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxcore_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxcore_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxcore_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxcore_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 38,44 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 38,44 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxrichtext_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxrichtext_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxrichtext_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxrichtext_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxxrc_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxxrc_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxxrc_bind.h 17 Nov 2007 00:14:57 -0000 1.5 --- wxxrc_bind.h 7 Dec 2007 02:13:11 -0000 1.6 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxnet_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxnet_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxnet_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxnet_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxbase_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxbase_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxbase_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxbase_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 20,26 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 20,26 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxmedia_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxmedia_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxmedia_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxmedia_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 22,28 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 22,28 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxgl_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxgl_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxgl_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxgl_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxstc_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxstc_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxstc_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxstc_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxaui_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxaui_bind.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxaui_bind.h 25 Nov 2007 21:34:04 -0000 1.6 --- wxaui_bind.h 7 Dec 2007 02:13:10 -0000 1.7 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxhtml_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxhtml_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxhtml_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxhtml_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- Index: wxxml_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxxml_bind.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxxml_bind.h 17 Nov 2007 00:14:56 -0000 1.5 --- wxxml_bind.h 7 Dec 2007 02:13:10 -0000 1.6 *************** *** 21,27 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 21,27 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- |
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12976/wxLua/bindings/wxwidgets Modified Files: wxadv_override.hpp wxbase_override.hpp wxcore_override.hpp wxhtml_override.hpp wxnet_override.hpp wxstc_override.hpp wxxml_override.hpp Log Message: Too many changes to list... A large portion of the internal workings of the wxLuaState have been rewritten. All of the data that was stored in wxLuaStateData that might be needed by a function taking a lua_State* is now in the LUA_REGISTRYINDEX. C functions have been added to access these values. The generated bindings no longer need to have "wxLuaState wxlState(L);" since everything can be done with the C functions. The result is that wxLua should be faster. Index: wxbase_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxbase_override.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxbase_override.hpp 5 Dec 2007 05:54:11 -0000 1.6 --- wxbase_override.hpp 7 Dec 2007 02:13:09 -0000 1.7 *************** *** 34,40 **** static int LUACALL wxLua_function_wxGetEnv(lua_State *L) { - wxLuaState wxlState(L); bool returns; ! wxString var = wxlState.GetwxStringType(1); wxString value; // call wxGetEnv --- 34,39 ---- static int LUACALL wxLua_function_wxGetEnv(lua_State *L) { [...1192 lines suppressed...] // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxOutputStream, returns); // return the number of parameters return 1; --- 880,894 ---- static int LUACALL wxLua_wxOutputStream_Write(lua_State *L) { wxOutputStream *returns; // size_t size ! size_t size = (size_t)wxlua_getintegertype(L, 3); // const void *buffer const void *buffer = (void *)lua_tostring(L, 2); // get this ! wxOutputStream *self = (wxOutputStream *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxOutputStream); // call Write returns = &self->Write(buffer, size); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxOutputStream, returns); // return the number of parameters return 1; Index: wxnet_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxnet_override.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxnet_override.hpp 16 Jul 2007 19:34:26 -0000 1.1 --- wxnet_override.hpp 7 Dec 2007 02:13:10 -0000 1.2 *************** *** 14,20 **** static int LUACALL wxLua_wxSocketBase_Peek(lua_State *L) { - wxLuaState wxlState(L); // unsigned long nbytes ! unsigned long nbytes = (unsigned long)wxlState.GetNumberType(2); // void * buffer void *buffer = malloc(nbytes); --- 14,19 ---- static int LUACALL wxLua_wxSocketBase_Peek(lua_State *L) { // unsigned long nbytes ! unsigned long nbytes = (unsigned long)wxlua_getintegertype(L, 2); // void * buffer void *buffer = malloc(nbytes); *************** *** 22,26 **** { // get this ! wxSocketBase *self = (wxSocketBase *)wxlState.GetUserDataType(1, s_wxluatag_wxSocketBase); // call Peek self->Peek(buffer, nbytes); --- 21,25 ---- { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketBase); // call Peek self->Peek(buffer, nbytes); *************** *** 38,44 **** static int LUACALL wxLua_wxSocketBase_Read(lua_State *L) { - wxLuaState wxlState(L); // unsigned long nbytes ! unsigned long nbytes = (unsigned long)wxlState.GetNumberType(2); // void * buffer void *buffer = malloc(nbytes); --- 37,42 ---- static int LUACALL wxLua_wxSocketBase_Read(lua_State *L) { // unsigned long nbytes ! unsigned long nbytes = (unsigned long)wxlua_getintegertype(L, 2); // void * buffer void *buffer = malloc(nbytes); *************** *** 46,50 **** { // get this ! wxSocketBase *self = (wxSocketBase *)wxlState.GetUserDataType(1, s_wxluatag_wxSocketBase); // call Peek self->Read(buffer, nbytes); --- 44,48 ---- { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketBase); // call Peek self->Read(buffer, nbytes); *************** *** 62,68 **** static int LUACALL wxLua_wxSocketBase_ReadMsg(lua_State *L) { - wxLuaState wxlState(L); // unsigned long nbytes ! unsigned long nbytes = (unsigned long)wxlState.GetNumberType(2); // void * buffer void *buffer = malloc(nbytes); --- 60,65 ---- static int LUACALL wxLua_wxSocketBase_ReadMsg(lua_State *L) { // unsigned long nbytes ! unsigned long nbytes = (unsigned long)wxlua_getintegertype(L, 2); // void * buffer void *buffer = malloc(nbytes); *************** *** 70,74 **** { // get this ! wxSocketBase *self = (wxSocketBase *)wxlState.GetUserDataType(1, s_wxluatag_wxSocketBase); // call Peek self->ReadMsg(buffer, nbytes); --- 67,71 ---- { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketBase); // call Peek self->ReadMsg(buffer, nbytes); *************** *** 86,90 **** static int LUACALL wxLua_wxSocketBase_Unread(lua_State *L) { - wxLuaState wxlState(L); // get number of arguments int argCount = lua_gettop(L); --- 83,86 ---- *************** *** 92,98 **** const char *buffer = lua_tostring(L, 2); // unsigned long nbytes ! unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlState.GetNumberType(3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxlState.GetUserDataType(1, s_wxluatag_wxSocketBase); // call Unread self->Unread(buffer, nbytes); --- 88,94 ---- const char *buffer = lua_tostring(L, 2); // unsigned long nbytes ! unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketBase); // call Unread self->Unread(buffer, nbytes); *************** *** 106,110 **** static int LUACALL wxLua_wxSocketBase_Write(lua_State *L) { - wxLuaState wxlState(L); // get number of arguments int argCount = lua_gettop(L); --- 102,105 ---- *************** *** 112,118 **** const char *buffer = lua_tostring(L, 2); // unsigned long nbytes ! unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlState.GetNumberType(3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxlState.GetUserDataType(1, s_wxluatag_wxSocketBase); // call Write self->Write(buffer, nbytes); --- 107,113 ---- const char *buffer = lua_tostring(L, 2); // unsigned long nbytes ! unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketBase); // call Write self->Write(buffer, nbytes); *************** *** 126,130 **** static int LUACALL wxLua_wxSocketBase_WriteMsg(lua_State *L) { - wxLuaState wxlState(L); // get number of arguments int argCount = lua_gettop(L); --- 121,124 ---- *************** *** 132,138 **** const char *buffer = lua_tostring(L, 2); // unsigned long nbytes ! unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlState.GetNumberType(3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxlState.GetUserDataType(1, s_wxluatag_wxSocketBase); // call WriteMsg self->WriteMsg(buffer, nbytes); --- 126,132 ---- const char *buffer = lua_tostring(L, 2); // unsigned long nbytes ! unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketBase); // call WriteMsg self->WriteMsg(buffer, nbytes); Index: wxstc_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxstc_override.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxstc_override.hpp 16 Jul 2007 19:34:26 -0000 1.1 --- wxstc_override.hpp 7 Dec 2007 02:13:10 -0000 1.2 *************** *** 14,22 **** static int LUACALL wxLua_wxStyledTextCtrl_GetCurLine(lua_State *L) { - wxLuaState wxlState(L); wxString returns; int linePos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); // call GetCurLine returns = self->GetCurLine(&linePos); --- 14,21 ---- static int LUACALL wxLua_wxStyledTextCtrl_GetCurLine(lua_State *L) { wxString returns; int linePos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); // call GetCurLine returns = self->GetCurLine(&linePos); *************** *** 33,41 **** static int LUACALL wxLua_wxStyledTextCtrl_GetSelection(lua_State *L) { - wxLuaState wxlState(L); int endPos; int startPos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); // call GetSelection self->GetSelection(&startPos, &endPos); --- 32,39 ---- static int LUACALL wxLua_wxStyledTextCtrl_GetSelection(lua_State *L) { int endPos; int startPos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); // call GetSelection self->GetSelection(&startPos, &endPos); *************** *** 52,56 **** static int LUACALL wxLua_wxStyledTextCtrl_SetStyleBytes(lua_State *L) { - wxLuaState wxlState(L); // const wxString &styleBytes wxCharBuffer styleBytes(lua_tostring(L, 3)); --- 50,53 ---- *************** *** 58,62 **** int length = (int)lua_tonumber(L, 2); // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); // call SetStyleBytes self->SetStyleBytes(length, styleBytes.data()); --- 55,59 ---- int length = (int)lua_tonumber(L, 2); // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextCtrl); // call SetStyleBytes self->SetStyleBytes(length, styleBytes.data()); Index: wxhtml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxhtml_override.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxhtml_override.hpp 17 Nov 2007 00:14:55 -0000 1.2 --- wxhtml_override.hpp 7 Dec 2007 02:13:10 -0000 1.3 *************** *** 16,25 **** static int LUACALL wxLua_wxHtmlCell_AdjustPagebreak(lua_State *L) { - wxLuaState wxlState(L); bool returns; // int * pagebreak ! int pagebreak = (int)wxlState.GetNumberType(2); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlCell); // call AdjustPagebreak returns = self->AdjustPagebreak(&pagebreak); --- 16,24 ---- static int LUACALL wxLua_wxHtmlCell_AdjustPagebreak(lua_State *L) { bool returns; // int * pagebreak ! int pagebreak = (int)wxlua_getintegertype(L, 2); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlCell); // call AdjustPagebreak returns = self->AdjustPagebreak(&pagebreak); *************** *** 35,46 **** static int LUACALL wxLua_wxHtmlCell_AdjustPagebreak(lua_State *L) { - wxLuaState wxlState(L); bool returns; // int * pagebreak ! int pagebreak = (int)wxlState.GetNumberType(3); // wxArrayInt& known_pagebreaks ! wxArrayInt* known_pagebreaks = (wxArrayInt *)wxlState.GetUserDataType(2, s_wxluatag_wxArrayInt); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlCell); // call AdjustPagebreak returns = self->AdjustPagebreak(&pagebreak, *known_pagebreaks); --- 34,44 ---- static int LUACALL wxLua_wxHtmlCell_AdjustPagebreak(lua_State *L) { bool returns; // int * pagebreak ! int pagebreak = (int)wxlua_getintegertype(L, 3); // wxArrayInt& known_pagebreaks ! wxArrayInt* known_pagebreaks = (wxArrayInt *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxArrayInt); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlCell); // call AdjustPagebreak returns = self->AdjustPagebreak(&pagebreak, *known_pagebreaks); *************** *** 59,68 **** static int LUACALL wxLua_wxHtmlCell_Find(lua_State *L) { - wxLuaState wxlState(L); const wxHtmlCell *returns = NULL; // int condition ! int condition = (int)wxlState.GetNumberType(2); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlCell); // call Find switch(lua_type(L, 3)) --- 57,65 ---- static int LUACALL wxLua_wxHtmlCell_Find(lua_State *L) { const wxHtmlCell *returns = NULL; // int condition ! int condition = (int)wxlua_getintegertype(L, 2); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlCell); // call Find switch(lua_type(L, 3)) *************** *** 74,78 **** case LUA_TSTRING: { ! wxString param = wxlState.GetwxStringType(3); returns = self->Find(condition, ¶m); } --- 71,75 ---- case LUA_TSTRING: { ! wxString param = wxlua_getwxstringtype(L, 3); returns = self->Find(condition, ¶m); } *************** *** 81,85 **** case LUA_TNUMBER: { ! int param = (int)wxlState.GetNumberType(3); returns = self->Find(condition, ¶m); } --- 78,82 ---- case LUA_TNUMBER: { ! int param = (int)wxlua_getnumbertype(L, 3); returns = self->Find(condition, ¶m); } *************** *** 87,96 **** default: ! wxlState.wxlua_Error("wxLua: Expected simple type for parameter 3."); break; } // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxHtmlCell, returns); // return the number of parameters return 1; --- 84,93 ---- default: ! wxlua_error(L, "wxLua: Expected simple type for parameter 3."); break; } // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxHtmlCell, returns); // return the number of parameters return 1; *************** *** 102,112 **** static int LUACALL wxLua_wxHtmlTag_GetParamAsColour(lua_State *L) { - wxLuaState wxlState(L); bool returns; wxColour *retColour = new wxColour; // const wxString& par ! wxString par = wxlState.GetwxStringType(2); // get this ! wxHtmlTag *self = (wxHtmlTag *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlTag); // call GetParamAsColour returns = self->GetParamAsColour(par, retColour); --- 99,108 ---- static int LUACALL wxLua_wxHtmlTag_GetParamAsColour(lua_State *L) { bool returns; wxColour *retColour = new wxColour; // const wxString& par ! wxString par = wxlua_getwxstringtype(L, 2); // get this ! wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlTag); // call GetParamAsColour returns = self->GetParamAsColour(par, retColour); *************** *** 114,118 **** // push the result number lua_pushboolean(L, returns); ! wxlState.PushUserDataType(s_wxluatag_wxColour, retColour); // return the number of parameters return 2; --- 110,114 ---- // push the result number lua_pushboolean(L, returns); ! wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, retColour); // return the number of parameters return 2; *************** *** 124,134 **** static int LUACALL wxLua_wxHtmlTag_GetParamAsInt(lua_State *L) { - wxLuaState wxlState(L); bool returns; int value; // const wxString& par ! wxString par = wxlState.GetwxStringType(2); // get this ! wxHtmlTag *self = (wxHtmlTag *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlTag); // call GetParamAsInt returns = self->GetParamAsInt(par, &value); --- 120,129 ---- static int LUACALL wxLua_wxHtmlTag_GetParamAsInt(lua_State *L) { bool returns; int value; // const wxString& par ! wxString par = wxlua_getwxstringtype(L, 2); // get this ! wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlTag); // call GetParamAsInt returns = self->GetParamAsInt(par, &value); *************** *** 146,150 **** static int LUACALL wxLua_wxHtmlWinParser_SetFonts(lua_State *L) { - wxLuaState wxlState(L); // const int *sizes #ifdef __WXMSW__ --- 141,144 ---- *************** *** 164,168 **** int count = 0; ! int *sizeArray = wxlState.GetIntArray(4, count); if (count > arraySize) --- 158,162 ---- int count = 0; ! int *sizeArray = wxlua_getintarray(L, 4, count); if (count > arraySize) *************** *** 186,194 **** // wxString fixed_face ! wxString fixed_face = wxlState.GetwxStringType(3); // wxString normal_face ! wxString normal_face = wxlState.GetwxStringType(2); // get this ! wxHtmlWinParser *self = (wxHtmlWinParser *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlWinParser); // call SetFonts self->SetFonts(normal_face, fixed_face, sizes); --- 180,188 ---- // wxString fixed_face ! wxString fixed_face = wxlua_getwxstringtype(L, 3); // wxString normal_face ! wxString normal_face = wxlua_getwxstringtype(L, 2); // get this ! wxHtmlWinParser *self = (wxHtmlWinParser *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlWinParser); // call SetFonts self->SetFonts(normal_face, fixed_face, sizes); *************** *** 202,206 **** static int LUACALL wxLua_wxHtmlWindow_SetFonts(lua_State *L) { - wxLuaState wxlState(L); // const int *sizes #ifdef __WXMSW__ --- 196,199 ---- *************** *** 220,224 **** int count = 0; ! int *sizeArray = wxlState.GetIntArray(4, count); if (count > arraySize) --- 213,217 ---- int count = 0; ! int *sizeArray = wxlua_getintarray(L, 4, count); if (count > arraySize) *************** *** 242,250 **** // wxString fixed_face ! wxString fixed_face = wxlState.GetwxStringType(3); // wxString normal_face ! wxString normal_face = wxlState.GetwxStringType(2); // get this ! wxHtmlWindow *self = (wxHtmlWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlWindow); // call SetFonts self->SetFonts(normal_face, fixed_face, sizes); --- 235,243 ---- // wxString fixed_face ! wxString fixed_face = wxlua_getwxstringtype(L, 3); // wxString normal_face ! wxString normal_face = wxlua_getwxstringtype(L, 2); // get this ! wxHtmlWindow *self = (wxHtmlWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHtmlWindow); // call SetFonts self->SetFonts(normal_face, fixed_face, sizes); *************** *** 265,286 **** int argCount = lua_gettop(L); // const wxString name = "wxLuaHtmlWindow" ! const wxString name = (argCount >= 6 ? wxlState.GetwxStringType(6) : wxString(wxT("wxLuaHtmlWindow"))); // long style = wxHW_SCROLLBAR_AUTO ! long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : wxHW_SCROLLBAR_AUTO); // const wxSize size = wxDefaultSize ! const wxSize * size = (argCount >= 4 ? (const wxSize *)wxlState.GetUserDataType(4, s_wxluatag_wxSize) : &wxDefaultSize); // const wxPoint pos = wxDefaultPosition ! const wxPoint * pos = (argCount >= 3 ? (const wxPoint *)wxlState.GetUserDataType(3, s_wxluatag_wxPoint) : &wxDefaultPosition); // wxWindowID id = -1 ! wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlState.GetNumberType(2) : -1); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); // call constructor returns = new wxLuaHtmlWindow(wxlState, parent, id, *pos, *size, style, name); // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLuaHtmlWindow, returns); return 1; --- 258,279 ---- int argCount = lua_gettop(L); // const wxString name = "wxLuaHtmlWindow" ! const wxString name = (argCount >= 6 ? wxlua_getwxstringtype(L, 6) : wxString(wxT("wxLuaHtmlWindow"))); // long style = wxHW_SCROLLBAR_AUTO ! long style = (argCount >= 5 ? (long)wxlua_getintegertype(L, 5) : wxHW_SCROLLBAR_AUTO); // const wxSize size = wxDefaultSize ! const wxSize * size = (argCount >= 4 ? (const wxSize *)wxluaT_getuserdatatype(L, 4, s_wxluatag_wxSize) : &wxDefaultSize); // const wxPoint pos = wxDefaultPosition ! const wxPoint * pos = (argCount >= 3 ? (const wxPoint *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxPoint) : &wxDefaultPosition); // wxWindowID id = -1 ! wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlua_getintegertype(L, 2) : -1); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor returns = new wxLuaHtmlWindow(wxlState, parent, id, *pos, *size, style, name); // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxluaW_addtrackedwindow(L, (wxWindow*)returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxLuaHtmlWindow, returns); return 1; Index: wxcore_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxcore_override.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxcore_override.hpp 4 Dec 2007 05:20:27 -0000 1.6 --- wxcore_override.hpp 7 Dec 2007 02:13:10 -0000 1.7 *************** *** 14,23 **** static int LUACALL wxLua_function_wxGetApp(lua_State *L) { - wxLuaState wxlState(L); wxApp *returns; // call wxGetApp(), actually not since you have to have IMPLEMENT_APP returns = wxTheApp; // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxApp, returns); // return the number of parameters return 1; [...3244 lines suppressed...] // add to tracked memory list ! wxlState.AddTrackedObject((wxLuaPrintout *)returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLuaPrintout, returns); return 1; --- 2763,2775 ---- int argCount = lua_gettop(L); // wxLuaObject pObject = NULL ! wxLuaObject * pObject = (argCount >= 2 ? (wxLuaObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxLuaObject) : NULL); // const wxString title = "Printout" ! const wxString title = (argCount >= 1 ? wxlua_getwxstringtype(L, 1) : wxString(wxT("Printout"))); // call constructor returns = new wxLuaPrintout(wxlState, title, pObject); // add to tracked memory list ! wxluaO_addtrackedobject(L, (wxLuaPrintout *)returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxLuaPrintout, returns); return 1; Index: wxadv_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxadv_override.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxadv_override.hpp 16 Jul 2007 19:34:23 -0000 1.1 --- wxadv_override.hpp 7 Dec 2007 02:13:09 -0000 1.2 *************** *** 14,23 **** static int LUACALL wxLua_wxCalendarCtrl_HitTest(lua_State *L) { - wxLuaState wxlState(L); wxCalendarHitTestResult returns; // const wxPoint pos ! const wxPoint * pos = (const wxPoint *)wxlState.GetUserDataType(2, s_wxluatag_wxPoint); // get this ! wxCalendarCtrl * self = (wxCalendarCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxCalendarCtrl); // call HitTest wxDateTime* date = new wxDateTime(); --- 14,22 ---- static int LUACALL wxLua_wxCalendarCtrl_HitTest(lua_State *L) { wxCalendarHitTestResult returns; // const wxPoint pos ! const wxPoint * pos = (const wxPoint *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxPoint); // get this ! wxCalendarCtrl * self = (wxCalendarCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxCalendarCtrl); // call HitTest wxDateTime* date = new wxDateTime(); *************** *** 27,31 **** // push the result number lua_pushnumber(L, returns); ! wxlState.PushUserDataType(s_wxluatag_wxDateTime, date); lua_pushnumber(L, wd); --- 26,30 ---- // push the result number lua_pushnumber(L, returns); ! wxluaT_pushuserdatatype(L, s_wxluatag_wxDateTime, date); lua_pushnumber(L, wd); *************** *** 42,51 **** static int LUACALL wxLua_wxGridCellAttr_GetAlignment(lua_State *L) { - wxLuaState wxlState(L); int horz; int vert; // get this ! wxGridCellAttr *self = (wxGridCellAttr *)wxlState.GetUserDataType(1, s_wxluatag_wxGridCellAttr); // call GetAlignment self->GetAlignment(&horz, &vert); --- 41,49 ---- static int LUACALL wxLua_wxGridCellAttr_GetAlignment(lua_State *L) { int horz; int vert; // get this ! wxGridCellAttr *self = (wxGridCellAttr *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGridCellAttr); // call GetAlignment self->GetAlignment(&horz, &vert); *************** *** 62,71 **** static int LUACALL wxLua_wxGridCellAttr_GetSize(lua_State *L) { - wxLuaState wxlState(L); int num_rows; int num_cols; // get this ! wxGridCellAttr *self = (wxGridCellAttr *)wxlState.GetUserDataType(1, s_wxluatag_wxGridCellAttr); // call GetAlignment self->GetSize(&num_rows, &num_cols); --- 60,68 ---- static int LUACALL wxLua_wxGridCellAttr_GetSize(lua_State *L) { int num_rows; int num_cols; // get this ! wxGridCellAttr *self = (wxGridCellAttr *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGridCellAttr); // call GetAlignment self->GetSize(&num_rows, &num_cols); *************** *** 82,90 **** static int LUACALL wxLua_wxGrid_GetRowLabelAlignment(lua_State *L) { - wxLuaState wxlState(L); int vert; int horz; // get this ! wxGrid *self = (wxGrid *)wxlState.GetUserDataType(1, s_wxluatag_wxGrid); // call GetRowLabelAlignment self->GetRowLabelAlignment(&horz, &vert); --- 79,86 ---- static int LUACALL wxLua_wxGrid_GetRowLabelAlignment(lua_State *L) { int vert; int horz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGrid); // call GetRowLabelAlignment self->GetRowLabelAlignment(&horz, &vert); *************** *** 101,109 **** static int LUACALL wxLua_wxGrid_GetColLabelAlignment(lua_State *L) { - wxLuaState wxlState(L); int vert; int horz; // get this ! wxGrid *self = (wxGrid *)wxlState.GetUserDataType(1, s_wxluatag_wxGrid); // call GetColLabelAlignment self->GetColLabelAlignment(&horz, &vert); --- 97,104 ---- static int LUACALL wxLua_wxGrid_GetColLabelAlignment(lua_State *L) { int vert; int horz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGrid); // call GetColLabelAlignment self->GetColLabelAlignment(&horz, &vert); *************** *** 120,128 **** static int LUACALL wxLua_wxGrid_GetDefaultCellAlignment(lua_State *L) { - wxLuaState wxlState(L); int vert; int horiz; // get this ! wxGrid *self = (wxGrid *)wxlState.GetUserDataType(1, s_wxluatag_wxGrid); // call GetDefaultCellAlignment self->GetDefaultCellAlignment(&horiz, &vert); --- 115,122 ---- static int LUACALL wxLua_wxGrid_GetDefaultCellAlignment(lua_State *L) { int vert; int horiz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGrid); // call GetDefaultCellAlignment self->GetDefaultCellAlignment(&horiz, &vert); *************** *** 139,143 **** static int LUACALL wxLua_wxGrid_GetCellAlignment(lua_State *L) { - wxLuaState wxlState(L); int vert; int horiz; --- 133,136 ---- *************** *** 147,151 **** int row = (int)lua_tonumber(L, 2); // get this ! wxGrid *self = (wxGrid *)wxlState.GetUserDataType(1, s_wxluatag_wxGrid); // call GetCellAlignment self->GetCellAlignment(row, col, &horiz, &vert); --- 140,144 ---- int row = (int)lua_tonumber(L, 2); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGrid); // call GetCellAlignment self->GetCellAlignment(row, col, &horiz, &vert); *************** *** 162,166 **** static int LUACALL wxLua_wxGrid_GetCellSize(lua_State *L) { - wxLuaState wxlState(L); int num_rows; int num_cols; --- 155,158 ---- *************** *** 170,174 **** int row = (int)lua_tonumber(L, 2); // get this ! wxGrid *self = (wxGrid *)wxlState.GetUserDataType(1, s_wxluatag_wxGrid); // call GetCellAlignment self->GetCellAlignment(row, col, &num_rows, &num_cols); --- 162,166 ---- int row = (int)lua_tonumber(L, 2); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGrid); // call GetCellAlignment self->GetCellAlignment(row, col, &num_rows, &num_cols); *************** *** 185,197 **** static int LUACALL wxLua_wxGrid_GetTextBoxSize(lua_State *L) { - wxLuaState wxlState(L); long height; long width; // wxArrayString& lines ! wxArrayString *lines = (wxArrayString *)wxlState.GetUserDataType(3, s_wxluatag_wxArrayString); // wxDC& dc ! wxDC *dc = (wxDC *)wxlState.GetUserDataType(2, s_wxluatag_wxDC); // get this ! wxGrid *self = (wxGrid *)wxlState.GetUserDataType(1, s_wxluatag_wxGrid); // call GetTextBoxSize self->GetTextBoxSize(*dc, *lines, &width, &height); --- 177,188 ---- static int LUACALL wxLua_wxGrid_GetTextBoxSize(lua_State *L) { long height; long width; // wxArrayString& lines ! wxArrayString *lines = (wxArrayString *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxArrayString); // wxDC& dc ! wxDC *dc = (wxDC *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDC); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGrid); // call GetTextBoxSize self->GetTextBoxSize(*dc, *lines, &width, &height); Index: wxxml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxxml_override.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxxml_override.hpp 22 Aug 2007 20:17:09 -0000 1.2 --- wxxml_override.hpp 7 Dec 2007 02:13:10 -0000 1.3 *************** *** 15,39 **** { wxluabind_removetableforcall(L); ! wxLuaState wxlState(L); wxXmlNode *returns; // wxXmlNode next ! wxXmlNode * next = (wxXmlNode *)wxlState.GetUserDataType(6, s_wxluatag_wxXmlNode); // wxXmlProperty props ! wxXmlProperty * props = (wxXmlProperty *)wxlState.GetUserDataType(5, s_wxluatag_wxXmlProperty); // const wxString content ! const wxString content = wxlState.GetwxStringType(4); // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxXmlNodeType type wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); // wxXmlNode parent ! wxXmlNode * parent = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); // call constructor returns = new wxXmlNode(parent, type, name, content, props, next); // add to tracked memory list if (parent == NULL) ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxXmlNode((wxXmlNode *)returns)); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); return 1; --- 15,39 ---- { wxluabind_removetableforcall(L); ! wxXmlNode *returns; // wxXmlNode next ! wxXmlNode * next = (wxXmlNode *)wxluaT_getuserdatatype(L, 6, s_wxluatag_wxXmlNode); // wxXmlProperty props ! wxXmlProperty * props = (wxXmlProperty *)wxluaT_getuserdatatype(L, 5, s_wxluatag_wxXmlProperty); // const wxString content ! const wxString content = wxlua_getwxstringtype(L, 4); // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxXmlNodeType type wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); // wxXmlNode parent ! wxXmlNode * parent = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlNode); // call constructor returns = new wxXmlNode(parent, type, name, content, props, next); // add to tracked memory list if (parent == NULL) ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxXmlNode((wxXmlNode *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlNode, returns); return 1; *************** *** 45,59 **** static int LUACALL wxLua_wxXmlNode_RemoveChild(lua_State *L) { - wxLuaState wxlState(L); bool returns; // wxXmlNode child ! wxXmlNode * child = (wxXmlNode *)wxlState.GetUserDataType(2, s_wxluatag_wxXmlNode); // get this ! wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); // call RemoveChild returns = (self->RemoveChild(child)); ! if (returns && !wxlState.IsTrackedObject(child)) ! wxlState.AddTrackedObject((long)child, new wxLua_wxObject_wxXmlNode(child)); // push the result flag --- 45,58 ---- static int LUACALL wxLua_wxXmlNode_RemoveChild(lua_State *L) { bool returns; // wxXmlNode child ! wxXmlNode * child = (wxXmlNode *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxXmlNode); // get this ! wxXmlNode * self = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlNode); // call RemoveChild returns = (self->RemoveChild(child)); ! if (returns && !wxluaO_istrackedobject(L, child)) ! wxluaO_addtrackedobject(L, (void*)child, new wxLua_wxObject_wxXmlNode(child)); // push the result flag *************** *** 68,79 **** static int LUACALL wxLua_wxXmlNode_GetPropValPtr(lua_State *L) { - wxLuaState wxlState(L); bool returns; // wxString *value wxString value; // const wxString& propName ! wxString propName = wxlState.GetwxStringType(2); // get this ! wxXmlNode *self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); // call GetPropVal returns = self->GetPropVal(propName, &value); --- 67,77 ---- static int LUACALL wxLua_wxXmlNode_GetPropValPtr(lua_State *L) { bool returns; // wxString *value wxString value; // const wxString& propName ! wxString propName = wxlua_getwxstringtype(L, 2); // get this ! wxXmlNode *self = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlNode); // call GetPropVal returns = self->GetPropVal(propName, &value); *************** *** 81,85 **** lua_pushboolean(L, returns); // push the result string ! wxlState.lua_PushString(value); // return the number of parameters return 2; --- 79,83 ---- lua_pushboolean(L, returns); // push the result string ! wxlua_pushwxString(L, value); // return the number of parameters return 2; |
From: John L. <jr...@us...> - 2007-12-07 02:13:43
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12976/wxLua/docs Modified Files: changelog.txt Log Message: Too many changes to list... A large portion of the internal workings of the wxLuaState have been rewritten. All of the data that was stored in wxLuaStateData that might be needed by a function taking a lua_State* is now in the LUA_REGISTRYINDEX. C functions have been added to access these values. The generated bindings no longer need to have "wxLuaState wxlState(L);" since everything can be done with the C functions. The result is that wxLua should be faster. Index: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** changelog.txt 30 Nov 2007 23:00:00 -0000 1.49 --- changelog.txt 7 Dec 2007 02:13:10 -0000 1.50 *************** *** 12,16 **** search for their usage. The functions in the wxLuaState used to be called just "txxx" and are now called wxluaT_Xxx where the first ! letter or each word is capitalized (camel-case); again for searching. - Made wxluaT_insert(L, idx) not pop the value that it refs since it may not be the one at the top of the stack. --- 12,16 ---- search for their usage. The functions in the wxLuaState used to be called just "txxx" and are now called wxluaT_Xxx where the first ! letter of each word is capitalized for searching. - Made wxluaT_insert(L, idx) not pop the value that it refs since it may not be the one at the top of the stack. *************** *** 30,33 **** --- 30,41 ---- not needed anymore. + * A large portion of the internal workings of the wxLuaState have been + rewritten. All of the data that was stored in wxLuaStateData that might + be needed by a function taking a lua_State* is now in the + LUA_REGISTRYINDEX. C functions have been added to access these values. + The generated bindings no longer need to have "wxLuaState wxlState(L);" + since everything can be done with the C functions. + The result is that wxLua should be faster. + version 2.8.4.2 -------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2007-12-07 02:13:43
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12976/wxLua/bindings Modified Files: genwxbind.lua Log Message: Too many changes to list... A large portion of the internal workings of the wxLuaState have been rewritten. All of the data that was stored in wxLuaStateData that might be needed by a function taking a lua_State* is now in the LUA_REGISTRYINDEX. C functions have been added to access these values. The generated bindings no longer need to have "wxLuaState wxlState(L);" since everything can be done with the C functions. The result is that wxLua should be faster. Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** genwxbind.lua 17 Nov 2007 00:14:54 -0000 1.150 --- genwxbind.lua 7 Dec 2007 02:13:09 -0000 1.151 *************** *** 18,22 **** -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 18 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. --- 18,22 ---- -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 19 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. *************** *** 2632,2635 **** --- 2632,2655 ---- -- --------------------------------------------------------------------------- + -- Remove the code line wxLuaState wxlState(L); if it won't be used. + -- --------------------------------------------------------------------------- + + function RemovewxLuaStateIfNotUsed(codeList) + -- remove the wxLuaState if we don't use it + local needs_wxluastate = -1 + for i = 1, #codeList do + if string.find(codeList[i], "wxLuaState wxl", 1, 1) then + needs_wxluastate = i + elseif string.find(codeList[i], "wxlState", 1, 1) then + needs_wxluastate = -1 + break + end + end + if (needs_wxluastate > 0) then + table.remove(codeList, needs_wxluastate) + end + end + + -- --------------------------------------------------------------------------- -- Create Language Binding - This generates c-binding to Lua interpreter -- --------------------------------------------------------------------------- *************** *** 2728,2748 **** table.insert(codeList, " wxLuaState wxlState(L);\n") CommentBindingTable(codeList, " // get this\n") ! table.insert(codeList, " "..parseObject.Name.." *self = ("..parseObject.Name.." *) wxlState.GetUserDataType(1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n") overload_argList = "&s_wxluatag_"..MakeClassVar(parseObject.Name)..", "..overload_argList if memberType == "wxString" then CommentBindingTable(codeList, " // push the result string\n") ! table.insert(codeList, " wxlState.lua_PushString(self->"..member.Name..");\n") elseif not numeric and (not memberPtr or (memberPtr == "&")) then CommentBindingTable(codeList, " // push the result datatype\n") -- if string.find(member.Name, "::") then ! -- table.insert(codeList, " wxlState.PushUserDataType(s_wxluatag_"..MakeClassVar(memberType)..", "..member.Name..");\n") -- else ! table.insert(codeList, " wxlState.PushUserDataType(s_wxluatag_"..MakeClassVar(memberType)..", &self->"..member.Name..");\n") -- end elseif not numeric then CommentBindingTable(codeList, " // push the result datatype\n") ! table.insert(codeList, " wxlState.PushUserDataType(s_wxluatag_"..MakeClassVar(memberType)..", self->"..member.Name..");\n") elseif (memberType == "BOOL") or (memberType == "bool") then --- 2748,2768 ---- table.insert(codeList, " wxLuaState wxlState(L);\n") CommentBindingTable(codeList, " // get this\n") ! table.insert(codeList, " "..parseObject.Name.." *self = ("..parseObject.Name.." *)wxluaT_getuserdatatype(L, 1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n") overload_argList = "&s_wxluatag_"..MakeClassVar(parseObject.Name)..", "..overload_argList if memberType == "wxString" then CommentBindingTable(codeList, " // push the result string\n") ! table.insert(codeList, " wxlua_pushwxString(L, self->"..member.Name..");\n") elseif not numeric and (not memberPtr or (memberPtr == "&")) then CommentBindingTable(codeList, " // push the result datatype\n") -- if string.find(member.Name, "::") then ! -- table.insert(codeList, " wxluaT_pushuserdatatype(L, s_wxluatag_"..MakeClassVar(memberType)..", "..member.Name..");\n") -- else ! table.insert(codeList, " wxluaT_pushuserdatatype(L, s_wxluatag_"..MakeClassVar(memberType)..", &self->"..member.Name..");\n") -- end elseif not numeric then CommentBindingTable(codeList, " // push the result datatype\n") ! table.insert(codeList, " wxluaT_pushuserdatatype(L, s_wxluatag_"..MakeClassVar(memberType)..", self->"..member.Name..");\n") elseif (memberType == "BOOL") or (memberType == "bool") then *************** *** 2766,2769 **** --- 2786,2791 ---- end + RemovewxLuaStateIfNotUsed(codeList) + local funcMapName = "s_wxluafunc_"..funcName *************** *** 2819,2831 **** overload_argList = overload_argList.."&s_wxluaarg_String, " CommentBindingTable(codeList, " // get the string value\n") ! table.insert(codeList, " wxString val = wxlState.GetwxStringType(2);\n") elseif not numeric and (not memberPtr or (memberPtr == "&")) then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(memberType)..", " CommentBindingTable(codeList, " // get the data type value\n") ! table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)wxlState.GetUserDataType(2, s_wxluatag_"..MakeClassVar(memberType)..");\n") elseif not numeric then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(memberType)..", " CommentBindingTable(codeList, " // get the data type value\n") ! table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)wxlState.GetUserDataType(2, s_wxluatag_"..MakeClassVar(memberType)..");\n") elseif (memberType == "BOOL") or (memberType == "bool") then overload_argList = overload_argList.."&s_wxluaarg_Boolean, " --- 2841,2853 ---- overload_argList = overload_argList.."&s_wxluaarg_String, " CommentBindingTable(codeList, " // get the string value\n") ! table.insert(codeList, " wxString val = wxlua_getwxstringtype(L, 2);\n") elseif not numeric and (not memberPtr or (memberPtr == "&")) then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(memberType)..", " CommentBindingTable(codeList, " // get the data type value\n") ! table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)wxluaT_getuserdatatype(L, 2, s_wxluatag_"..MakeClassVar(memberType)..");\n") elseif not numeric then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(memberType)..", " CommentBindingTable(codeList, " // get the data type value\n") ! table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)wxluaT_getuserdatatype(L, 2, s_wxluatag_"..MakeClassVar(memberType)..");\n") elseif (memberType == "BOOL") or (memberType == "bool") then overload_argList = overload_argList.."&s_wxluaarg_Boolean, " *************** *** 2843,2847 **** CommentBindingTable(codeList, " // get this\n") ! table.insert(codeList, " "..parseObject.Name.." *self = ("..parseObject.Name.." *)wxlState.GetUserDataType(1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n") overload_argList = "&s_wxluatag_"..MakeClassVar(parseObject.Name)..", "..overload_argList --- 2865,2869 ---- CommentBindingTable(codeList, " // get this\n") ! table.insert(codeList, " "..parseObject.Name.." *self = ("..parseObject.Name.." *)wxluaT_getuserdatatype(L, 1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n") overload_argList = "&s_wxluatag_"..MakeClassVar(parseObject.Name)..", "..overload_argList *************** *** 2863,2866 **** --- 2885,2890 ---- end + RemovewxLuaStateIfNotUsed(codeList) + local funcMapName = "s_wxluafunc_"..funcName *************** *** 3121,3141 **** ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then overload_argList = overload_argList.."&s_wxluatag_wxArrayString, " ! argItem = "wxArrayString(); wxlState.GetwxArrayString("..argNum..", "..argName..")" ! declare = "wxArrayString " elseif ((argType == "wxSortedArrayString") and ((indirectionCount == 0) or ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then overload_argList = overload_argList.."&s_wxluatag_wxSortedArrayString, " ! argItem = "wxArrayString(); wxlState.GetwxArrayString("..argNum..", "..argName..")" ! declare = "wxSortedArrayString " elseif ((argType == "wxArrayInt") and ((indirectionCount == 0) or ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then overload_argList = overload_argList.."&s_wxluatag_wxArrayInt, " ! argItem = "wxArrayInt(); wxlState.GetwxArrayInt("..argNum..", "..argName..")" ! declare = "wxArrayInt " elseif argType == "IntArray_FromLuaTable" then overload_argList = overload_argList.."&s_wxluaarg_Table, " ! argItem = "NULL; ptr = "..argName.." = wxlState.GetIntArray("..argNum..", count_)" declare = "int count_ = 0; wxLuaSmartIntArray ptr; int*" argList = argList.."count_, " --- 3145,3165 ---- ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then overload_argList = overload_argList.."&s_wxluatag_wxArrayString, " ! argItem = "wxlua_getwxArrayString(L, "..argNum..")" ! declare = "wxLuaSmartwxArrayString" elseif ((argType == "wxSortedArrayString") and ((indirectionCount == 0) or ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then overload_argList = overload_argList.."&s_wxluatag_wxSortedArrayString, " ! argItem = "wxlua_getwxSortedArrayString(L, "..argNum..")" ! declare = "wxLuaSmartwxSortedArrayString" elseif ((argType == "wxArrayInt") and ((indirectionCount == 0) or ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then overload_argList = overload_argList.."&s_wxluatag_wxArrayInt, " ! argItem = "wxlua_getwxArrayInt(L, "..argNum..")" ! declare = "wxLuaSmartwxArrayInt" elseif argType == "IntArray_FromLuaTable" then overload_argList = overload_argList.."&s_wxluaarg_Table, " ! argItem = "NULL; ptr = "..argName.." = wxlua_getintarray(L, "..argNum..", count_)" declare = "int count_ = 0; wxLuaSmartIntArray ptr; int*" argList = argList.."count_, " *************** *** 3163,3167 **** overload_argList = overload_argList.."&s_wxluaarg_Table, " ! argItem = "wxlState.GetStringArray("..argNum..", count)" --declare = "int count = 0; wxLuaSmartStringArray ptr; "..argTypeWithAttrib.." "..argName.."; ptr = " declare = "int count = 0; wxLuaSmartStringArray " --- 3187,3191 ---- overload_argList = overload_argList.."&s_wxluaarg_Table, " ! argItem = "wxlua_getwxStringarray("..argNum..", count)" --declare = "int count = 0; wxLuaSmartStringArray ptr; "..argTypeWithAttrib.." "..argName.."; ptr = " declare = "int count = 0; wxLuaSmartStringArray " *************** *** 3173,3188 **** overload_argList = overload_argList.."&s_wxluaarg_Table, " ! argItem = "wxlState.GetIntArray("..argNum..", count)" --declare = "int count = 0; wxLuaSmartIntArray ptr; "..argTypeWithAttrib.." "..argName.."; ptr = " declare = "int count = 0; wxLuaSmartIntArray " elseif not numeric then ! argItem = "("..argTypeWithAttrib..") wxlState.GetUserDataType("..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else ! argItem = "("..argTypeWithAttrib..") wxlState.wxlua_ToUserdata("..argNum..")" end elseif (indirectionCount == 1) and (argPtr == "*") then if (argType == "wxString") or (argType == "wxChar") then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlState.GetwxStringType("..argNum..")" -- Default String Value --- 3197,3212 ---- overload_argList = overload_argList.."&s_wxluaarg_Table, " ! argItem = "wxlua_getintarray(L, "..argNum..", count)" --declare = "int count = 0; wxLuaSmartIntArray ptr; "..argTypeWithAttrib.." "..argName.."; ptr = " declare = "int count = 0; wxLuaSmartIntArray " elseif not numeric then ! argItem = "("..argTypeWithAttrib..")wxluaT_getuserdatatype(L, "..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else ! argItem = "("..argTypeWithAttrib..")wxlua_touserdata(L, "..argNum..")" end elseif (indirectionCount == 1) and (argPtr == "*") then if (argType == "wxString") or (argType == "wxChar") then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxstringtype(L, "..argNum..")" -- Default String Value *************** *** 3204,3208 **** elseif argType == "char" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlState.GetStringType("..argNum..")" argTypeWithAttrib = "wxCharBuffer" --- 3228,3232 ---- elseif argType == "char" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getstringtype(L, "..argNum..")" argTypeWithAttrib = "wxCharBuffer" *************** *** 3217,3234 **** if not numeric then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(argType)..", " ! argItem = "("..argTypeWithAttrib..")wxlState.GetUserDataType("..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else overload_argList = overload_argList.."&s_wxluaarg_LightUserData, " ! argItem = "("..argTypeWithAttrib..")wxlState.wxlua_ToUserdata("..argNum..")" end if param.GC then if dataTypeTable[argType]["%encapsulate"] then ! table.insert(gcList, " if (!wxlState.IsTrackedObject("..argName..")) wxlState.AddTrackedObject((long)"..argName..", new wxLua_wxObject_"..MakeVar(argType).."("..argName.."));\n") else ! table.insert(gcList, " if (!wxlState.IsTrackedObject("..argName..")) wxlState.AddTrackedObject("..argName..");\n") end elseif param.UnGC then ! table.insert(gcList, " if (wxlState.IsTrackedObject("..argName..")) wxlState.RemoveTrackedObject("..argName..", wxLuaState::UNDELETE_OBJECT);\n") end --- 3241,3258 ---- if not numeric then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(argType)..", " ! argItem = "("..argTypeWithAttrib..")wxluaT_getuserdatatype(L, "..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else overload_argList = overload_argList.."&s_wxluaarg_LightUserData, " ! argItem = "("..argTypeWithAttrib..")wxlua_touserdata(L, "..argNum..")" end if param.GC then if dataTypeTable[argType]["%encapsulate"] then ! table.insert(gcList, " if (!wxluaO_istrackedobject(L, "..argName..")) wxluaO_addtrackedobject(L, (void*)"..argName..", new wxLua_wxObject_"..MakeVar(argType).."("..argName.."));\n") else ! table.insert(gcList, " if (!wxluaO_istrackedobject(L, "..argName..")) wxluaO_addtrackedobject(L, "..argName..");\n") end elseif param.UnGC then ! table.insert(gcList, " if (wxluaO_istrackedobject(L, "..argName..")) wxluaO_removetrackedobject(L, "..argName..", wxLUA_UNDELETE_OBJECT);\n") end *************** *** 3238,3251 **** overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(argType)..", " argTypeWithAttrib = argTypeWithAttrib.." **" ! argItem = "("..argTypeWithAttrib..")wxlState.GetUserDataType("..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else overload_argList = overload_argList.."&s_wxluaarg_LightUserData, " argTypeWithAttrib = argTypeWithAttrib.." *" ! argItem = "("..argTypeWithAttrib..")wxlState.wxlua_ToUserdata("..argNum..")" end elseif (indirectionCount == 1) and (argPtr == "&") then if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlState.GetwxStringType("..argNum..")" -- Default String Value --- 3262,3275 ---- overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(argType)..", " argTypeWithAttrib = argTypeWithAttrib.." **" ! argItem = "("..argTypeWithAttrib..")wxluaT_getuserdatatype(L, "..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else overload_argList = overload_argList.."&s_wxluaarg_LightUserData, " argTypeWithAttrib = argTypeWithAttrib.." *" ! argItem = "("..argTypeWithAttrib..")wxlua_touserdata(L, "..argNum..")" end elseif (indirectionCount == 1) and (argPtr == "&") then if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxstringtype(L, "..argNum..")" -- Default String Value *************** *** 3263,3270 **** if not numeric then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(argType)..", " ! argItem = "("..argTypeWithAttrib..")wxlState.GetUserDataType("..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else overload_argList = overload_argList.."&s_wxluaarg_LightUserData, " ! argItem = "("..argTypeWithAttrib..")wxlState.wxlua_ToUserdata("..argNum..")" end --- 3287,3294 ---- if not numeric then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(argType)..", " ! argItem = "("..argTypeWithAttrib..")wxluaT_getuserdatatype(L, "..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else overload_argList = overload_argList.."&s_wxluaarg_LightUserData, " ! argItem = "("..argTypeWithAttrib..")wxlua_touserdata(L, "..argNum..")" end *************** *** 3277,3281 **** if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlState.GetwxStringType("..argNum..")" -- Default String Value --- 3301,3305 ---- if argType == "wxString" then overload_argList = overload_argList.."&s_wxluaarg_String, " ! argItem = "wxlua_getwxstringtype(L, "..argNum..")" -- Default String Value *************** *** 3297,3301 **** elseif not numeric then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(argType)..", " ! argItem = "*("..argTypeWithAttrib.."*)wxlState.GetUserDataType("..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else overload_argList = overload_argList.."&s_wxluaarg_Number, " --- 3321,3325 ---- elseif not numeric then overload_argList = overload_argList.."&s_wxluatag_"..MakeClassVar(argType)..", " ! argItem = "*("..argTypeWithAttrib.."*)wxluaT_getuserdatatype(L, "..argNum..", s_wxluatag_"..MakeClassVar(argType)..")" else overload_argList = overload_argList.."&s_wxluaarg_Number, " *************** *** 3542,3556 **** if parseObject["%encapsulate"] then ! table.insert(codeList, " wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_"..MakeVar(parseObject.Name).."(("..returnCast..")returns));\n") else ! table.insert(codeList, " wxlState.AddTrackedObject(returns);\n") end elseif not parseObject["%noclassinfo"] then CommentBindingTable(codeList, " // add to tracked window list, it will check validity\n") ! table.insert(codeList, " wxlState.AddTrackedWindow(returns);\n") end CommentBindingTable(codeList, " // push the constructed class pointer\n") ! table.insert(codeList, " wxlState.PushUserDataType(s_wxluatag_"..MakeClassVar(parseObject.Name)..", returns);\n") table.insert(codeList, "\n return 1;\n") --- 3566,3580 ---- if parseObject["%encapsulate"] then ! table.insert(codeList, " wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_"..MakeVar(parseObject.Name).."(("..returnCast..")returns));\n") else ! table.insert(codeList, " wxluaO_addtrackedobject(L, returns);\n") end elseif not parseObject["%noclassinfo"] then CommentBindingTable(codeList, " // add to tracked window list, it will check validity\n") ! table.insert(codeList, " wxluaW_addtrackedwindow(L, returns);\n") end CommentBindingTable(codeList, " // push the constructed class pointer\n") ! table.insert(codeList, " wxluaT_pushuserdatatype(L, s_wxluatag_"..MakeClassVar(parseObject.Name)..", returns);\n") table.insert(codeList, "\n return 1;\n") *************** *** 3565,3578 **** CommentBindingTable(codeList, " // get this\n") ! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *)wxlState.GetUserDataType(1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n") overload_argList = "&s_wxluatag_"..MakeClassVar(parseObject.Name)..", "..overload_argList if parseObject["%ungc_this"] then ! table.insert(codeList, " wxlState.RemoveTrackedObject(self, wxLuaState::UNDELETE_OBJECT);\n") elseif parseObject["%gc_this"] then if parseObject["%encapsulate"] then ! table.insert(codeList, " if (!wxlState.IsTrackedObject(self)) wxlState.AddTrackedObject((long)self, new wxLua_wxObject_"..MakeClassVar(parseObject.Name).."(self));\n") else ! table.insert(codeList, " wxlState.AddTrackedObject(self);\n") end end --- 3589,3602 ---- CommentBindingTable(codeList, " // get this\n") ! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *)wxluaT_getuserdatatype(L, 1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n") overload_argList = "&s_wxluatag_"..MakeClassVar(parseObject.Name)..", "..overload_argList if parseObject["%ungc_this"] then ! table.insert(codeList, " wxluaO_removetrackedobject(L, self, wxLUA_UNDELETE_OBJECT);\n") elseif parseObject["%gc_this"] then if parseObject["%encapsulate"] then ! table.insert(codeList, " if (!wxluaO_istrackedobject(L, self)) wxluaO_addtrackedobject(L, (void*)self, new wxLua_wxObject_"..MakeClassVar(parseObject.Name).."(self));\n") else ! table.insert(codeList, " wxluaO_addtrackedobject(L, self);\n") end end *************** *** 3632,3638 **** if dataTypeTable[memberType]["%encapsulate"] then ! table.insert(codeList, " wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_"..MakeVar(memberType).."(("..returnCast..")returns));\n") else ! table.insert(codeList, " wxlState.AddTrackedObject(("..returnCast..")returns);\n") end --- 3656,3662 ---- if dataTypeTable[memberType]["%encapsulate"] then ! table.insert(codeList, " wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_"..MakeVar(memberType).."(("..returnCast..")returns));\n") else ! table.insert(codeList, " wxluaO_addtrackedobject(L, ("..returnCast..")returns);\n") end *************** *** 3644,3653 **** if member.GC then if dataTypeTable[memberType]["%encapsulate"] then ! table.insert(codeList, " if (!wxlState.IsTrackedObject(returns)) wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_"..MakeVar(memberType).."(returns));\n") else ! table.insert(codeList, " if (!wxlState.IsTrackedObject(returns)) wxlState.AddTrackedObject(returns);\n") end elseif member.UnGC then ! table.insert(codeList, " if (wxlState.IsTrackedObject(returns)) wxlState.RemoveTrackedObject(returns, wxLuaState::UNDELETE_OBJECT);\n") end --- 3668,3677 ---- if member.GC then if dataTypeTable[memberType]["%encapsulate"] then ! table.insert(codeList, " if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_"..MakeVar(memberType).."(returns));\n") else ! table.insert(codeList, " if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, returns);\n") end elseif member.UnGC then ! table.insert(codeList, " if (wxluaO_istrackedobject(L, returns)) wxluaO_removetrackedobject(L, returns, wxLUA_UNDELETE_OBJECT);\n") end *************** *** 3659,3666 **** if memberType == "wxString" then CommentBindingTable(codeList, " // push the result string\n") ! table.insert(codeList, " wxlState.lua_PushString("..returnPtr.."returns);\n") elseif not numeric then CommentBindingTable(codeList, " // push the result datatype\n") ! table.insert(codeList, " wxlState.PushUserDataType(s_wxluatag_"..MakeClassVar(memberType)..", returns);\n") elseif (member.DataType == "BOOL") or (member.DataType == "bool") then CommentBindingTable(codeList, " // push the result flag\n") --- 3683,3690 ---- if memberType == "wxString" then CommentBindingTable(codeList, " // push the result string\n") ! table.insert(codeList, " wxlua_pushwxString(L, "..returnPtr.."returns);\n") elseif not numeric then CommentBindingTable(codeList, " // push the result datatype\n") ! table.insert(codeList, " wxluaT_pushuserdatatype(L, s_wxluatag_"..MakeClassVar(memberType)..", returns);\n") elseif (member.DataType == "BOOL") or (member.DataType == "bool") then CommentBindingTable(codeList, " // push the result flag\n") *************** *** 3697,3713 **** end ! -- remove the wxLuaState if we don't use it ! local needs_wxluastate = -1 ! for i = 1, #codeList do ! if string.find(codeList[i], "wxLuaState", 1, 1) then ! needs_wxluastate = i ! elseif string.find(codeList[i], "wxlState", 1, 1) then ! needs_wxluastate = -1 ! break ! end ! end ! if (needs_wxluastate > 0) then ! table.remove(codeList, needs_wxluastate) ! end methodcondition = FixCondition(methodcondition) --- 3721,3725 ---- end ! RemovewxLuaStateIfNotUsed(codeList) methodcondition = FixCondition(methodcondition) *************** *** 3818,3824 **** table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") table.insert(codeList, " wxLuaState wxlState(L);\n") ! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *)wxlState.GetUserDataType(1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n") CommentBindingTable(codeList, " // if removed from tracked mem list, reset the tag so that gc() is not called on this object.\n") ! table.insert(codeList, " if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT))\n") table.insert(codeList, " {\n") table.insert(codeList, " lua_pushnil(L);\n") --- 3830,3836 ---- table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") table.insert(codeList, " wxLuaState wxlState(L);\n") ! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *)wxluaT_getuserdatatype(L, 1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n") CommentBindingTable(codeList, " // if removed from tracked mem list, reset the tag so that gc() is not called on this object.\n") ! table.insert(codeList, " if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT))\n") table.insert(codeList, " {\n") table.insert(codeList, " lua_pushnil(L);\n") *************** *** 3835,3838 **** --- 3847,3852 ---- local condition = FixCondition(parseObject.Condition) + RemovewxLuaStateIfNotUsed(codeList) + local delMethodBinding = { *************** *** 4568,4575 **** CommentBindingTable(codeList, "// Overloaded function for "..methodBindings[1].ClassName.."::"..methodBindings[1].LuaName.."\n") table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") - table.insert(codeList, " wxLuaState wxlState(L);\n") table.insert(codeList, " static wxLuaBindMethod overload_method = \n") table.insert(codeList, " "..methodMap..";\n") ! table.insert(codeList, " return wxlState.CallOverloadedFunction(&overload_method);\n") table.insert(codeList, "}\n") --- 4582,4588 ---- CommentBindingTable(codeList, "// Overloaded function for "..methodBindings[1].ClassName.."::"..methodBindings[1].LuaName.."\n") table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") table.insert(codeList, " static wxLuaBindMethod overload_method = \n") table.insert(codeList, " "..methodMap..";\n") ! table.insert(codeList, " return wxlua_CallOverloadedFunction(L, &overload_method);\n") table.insert(codeList, "}\n") |
From: John L. <jr...@us...> - 2007-12-07 02:13:43
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12976/wxLua/bindings/wxlua Modified Files: override.hpp wxlua.i Log Message: Too many changes to list... A large portion of the internal workings of the wxLuaState have been rewritten. All of the data that was stored in wxLuaStateData that might be needed by a function taking a lua_State* is now in the LUA_REGISTRYINDEX. C functions have been added to access these values. The generated bindings no longer need to have "wxLuaState wxlState(L);" since everything can be done with the C functions. The result is that wxLua should be faster. Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua.i,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wxlua.i 17 Nov 2007 00:14:55 -0000 1.9 --- wxlua.i 7 Dec 2007 02:13:09 -0000 1.10 *************** *** 41,49 **** // Get a table of all tracked wxEvent callbacks that have been installed using // wxEvtHandler::Connect(...) ! // Example output : { ["wxEVT_COMMAND_TOOL_CLICKED"] = 2, ... } %function LuaTable GetTrackedEventCallbacks() // Get a table of all wxWindow derived classes that have been created in wxLua. ! // Example output : { ["wxFrame"] = 1, ["wxButton"] = 4 } %function LuaTable GetTrackedWindows() --- 41,49 ---- // Get a table of all tracked wxEvent callbacks that have been installed using // wxEvtHandler::Connect(...) ! // "wxEVT_XXX(evt#) -> wxLuaCallback(&callback, ids %d %d)|wxEvtHandler(&evthandler) -> wxEvtHandlerClassName" %function LuaTable GetTrackedEventCallbacks() // Get a table of all wxWindow derived classes that have been created in wxLua. ! // "wxWindowClassName(&win, id=%d)|wxLuaDestroyCallback(&callback)" %function LuaTable GetTrackedWindows() Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** override.hpp 5 Dec 2007 05:54:11 -0000 1.10 --- override.hpp 7 Dec 2007 02:13:09 -0000 1.11 *************** *** 37,53 **** { wxLuaState wxlState(L); ! wxArrayString strArr = wxlState.GetTrackedWindowStrings(); ! size_t n, count = strArr.GetCount(); ! long val = 0; ! lua_createtable(L, 0, count); ! ! for (n = 0; n < count; ++n) ! { ! lua_pushstring(L, wx2lua(strArr[n].BeforeLast(wxT(' ')))); ! strArr[n].AfterLast(wxT(' ')).ToLong(&val); ! lua_pushnumber(L, (double)val); ! lua_rawset(L, -3); ! } ! return 1; } --- 37,41 ---- { wxLuaState wxlState(L); ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedWindowStrings()); return 1; } *************** *** 59,75 **** { wxLuaState wxlState(L); ! wxArrayString strArr = wxlState.GetTrackedObjectStrings(); ! size_t n, count = strArr.GetCount(); ! long val = 0; ! lua_createtable(L, 0, count); ! ! for (n = 0; n < count; ++n) ! { ! lua_pushstring(L, wx2lua(strArr[n].BeforeLast(wxT(' ')))); ! strArr[n].AfterLast(wxT(' ')).ToLong(&val); ! lua_pushnumber(L, (double)val); ! lua_rawset(L, -3); ! } ! return 1; } --- 47,51 ---- { wxLuaState wxlState(L); ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedObjectStrings()); return 1; } *************** *** 81,97 **** { wxLuaState wxlState(L); ! wxArrayString strArr = wxlState.GetTrackedCallbackStrings(); ! size_t n, count = strArr.GetCount(); ! long val = 0; ! lua_createtable(L, 0, count); ! ! for (n = 0; n < count; ++n) ! { ! lua_pushstring(L, wx2lua(strArr[n].BeforeFirst(wxT(' ')))); ! strArr[n].AfterLast(wxT(' ')).ToLong(&val); ! lua_pushnumber(L, (double)val); ! lua_rawset(L, -3); ! } ! return 1; } --- 57,61 ---- { wxLuaState wxlState(L); ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedCallbackStrings()); return 1; } *************** *** 103,119 **** { wxLuaState wxlState(L); ! wxArrayString strArr = wxlState.GetTrackedWinDestroyCallbackStrings(); ! size_t n, count = strArr.GetCount(); ! long val = 0; ! lua_createtable(L, 0, count); ! ! for (n = 0; n < count; ++n) ! { ! lua_pushstring(L, wx2lua(strArr[n].BeforeLast(wxT(' ')))); ! strArr[n].AfterLast(wxT(' ')).ToLong(&val); ! lua_pushnumber(L, (double)val); ! lua_rawset(L, -3); ! } ! return 1; } --- 67,71 ---- { wxLuaState wxlState(L); ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedWinDestroyCallbackStrings()); return 1; } |
From: John L. <jr...@us...> - 2007-12-07 02:13:43
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12976/wxLua/apps/wxluacan/src Modified Files: wxluacan.cpp wxluacan.h wxluacan_bind.cpp Log Message: Too many changes to list... A large portion of the internal workings of the wxLuaState have been rewritten. All of the data that was stored in wxLuaStateData that might be needed by a function taking a lua_State* is now in the LUA_REGISTRYINDEX. C functions have been added to access these values. The generated bindings no longer need to have "wxLuaState wxlState(L);" since everything can be done with the C functions. The result is that wxLua should be faster. Index: wxluacan.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wxluacan.cpp 18 Jun 2007 21:40:26 -0000 1.33 --- wxluacan.cpp 7 Dec 2007 02:13:09 -0000 1.34 *************** *** 33,41 **** static int LUACALL wxLua_wxlCanObj_AddObject(lua_State *L) { - wxLuaState wxlState(L); // wxlCanObj canobj ! wxlCanObj * canobj = (wxlCanObj *)wxlState.GetUserDataType(2, s_wxluatag_wxlCanObj); // get this ! wxlCanObj * self = (wxlCanObj *)wxlState.GetUserDataType(1, s_wxluatag_wxlCanObj); // call AddObject self->AddObject(canobj); --- 33,40 ---- static int LUACALL wxLua_wxlCanObj_AddObject(lua_State *L) { // wxlCanObj canobj ! wxlCanObj * canobj = (wxlCanObj *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxlCanObj); // get this ! wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call AddObject self->AddObject(canobj); *************** *** 50,57 **** static int LUACALL wxLua_wxlCanObj_GetX(lua_State *L) { - wxLuaState wxlState(L); double returns; // get this ! wxlCanObj * self = (wxlCanObj *)wxlState.GetUserDataType(1, s_wxluatag_wxlCanObj); // call GetX returns = (self->GetX()); --- 49,55 ---- 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()); *************** *** 68,75 **** static int LUACALL wxLua_wxlCanObj_GetY(lua_State *L) { - wxLuaState wxlState(L); double returns; // get this ! wxlCanObj * self = (wxlCanObj *)wxlState.GetUserDataType(1, s_wxluatag_wxlCanObj); // call GetY returns = (self->GetY()); --- 66,72 ---- 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()); *************** *** 88,96 **** static int LUACALL wxLua_wxlCanObj_SetBrush(lua_State *L) { - wxLuaState wxlState(L); // const wxBrush brush ! const wxBrush * brush = (const wxBrush *)wxlState.GetUserDataType(2, s_wxluatag_wxBrush); // get this ! wxlCanObj * self = (wxlCanObj *)wxlState.GetUserDataType(1, s_wxluatag_wxlCanObj); // call SetBrush self->SetBrush(*brush); --- 85,92 ---- static int LUACALL wxLua_wxlCanObj_SetBrush(lua_State *L) { // const wxBrush brush ! const wxBrush * brush = (const wxBrush *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxBrush); // get this ! wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call SetBrush self->SetBrush(*brush); *************** *** 105,113 **** static int LUACALL wxLua_wxlCanObj_SetPen(lua_State *L) { - wxLuaState wxlState(L); // const wxPen pen ! const wxPen * pen = (const wxPen *)wxlState.GetUserDataType(2, s_wxluatag_wxPen); // get this ! wxlCanObj * self = (wxlCanObj *)wxlState.GetUserDataType(1, s_wxluatag_wxlCanObj); // call SetPen self->SetPen(*pen); --- 101,108 ---- static int LUACALL wxLua_wxlCanObj_SetPen(lua_State *L) { // const wxPen pen ! const wxPen * pen = (const wxPen *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxPen); // get this ! wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call SetPen self->SetPen(*pen); *************** *** 124,128 **** static int LUACALL wxLua_wxlCanObj_SetPending(lua_State *L) { - wxLuaState wxlState(L); // get number of arguments int argCount = lua_gettop(L); --- 119,122 ---- *************** *** 130,134 **** bool pending = (argCount >= 2 ? wxlua_getbooleantype(L, 2) : true); // get this ! wxlCanObj * self = (wxlCanObj *)wxlState.GetUserDataType(1, s_wxluatag_wxlCanObj); // call SetPending self->SetPending(pending); --- 124,128 ---- bool pending = (argCount >= 2 ? wxlua_getbooleantype(L, 2) : true); // get this ! wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call SetPending self->SetPending(pending); *************** *** 143,147 **** static int LUACALL wxLua_wxlCanObj_SetPos(lua_State *L) { - wxLuaState wxlState(L); // double y double y = (double)wxlua_getnumbertype(L, 3); --- 137,140 ---- *************** *** 149,153 **** double x = (double)wxlua_getnumbertype(L, 2); // get this ! wxlCanObj * self = (wxlCanObj *)wxlState.GetUserDataType(1, s_wxluatag_wxlCanObj); // call SetPos self->SetPos(x, y); --- 142,146 ---- double x = (double)wxlua_getnumbertype(L, 2); // get this ! wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call SetPos self->SetPos(x, y); *************** *** 163,167 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxlCanObj *returns; // get number of arguments --- 156,159 ---- *************** *** 174,178 **** returns = new wxlCanObj(x, y); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxlCanObj, returns); return 1; --- 166,170 ---- returns = new wxlCanObj(x, y); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObj, returns); return 1; *************** *** 215,219 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxlCanObjRect *returns; // double h --- 207,210 ---- *************** *** 228,232 **** returns = new wxlCanObjRect(x, y, w, h); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxlCanObjRect, returns); return 1; --- 219,223 ---- returns = new wxlCanObjRect(x, y, w, h); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjRect, returns); return 1; *************** *** 258,262 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxlCanObjCircle *returns; // double r --- 249,252 ---- *************** *** 269,273 **** returns = new wxlCanObjCircle(x, y, r); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxlCanObjCircle, returns); return 1; --- 259,263 ---- returns = new wxlCanObjCircle(x, y, r); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjCircle, returns); return 1; *************** *** 299,306 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxlCanObjScript *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // double y double y = (double)wxlua_getnumbertype(L, 2); --- 289,295 ---- { wxluabind_removetableforcall(L); wxlCanObjScript *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // double y double y = (double)wxlua_getnumbertype(L, 2); *************** *** 310,314 **** returns = new wxlCanObjScript(x, y, name); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxlCanObjScript, returns); return 1; --- 299,303 ---- returns = new wxlCanObjScript(x, y, name); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjScript, returns); return 1; *************** *** 339,347 **** static int LUACALL wxLua_wxlCanObjAddScript_SetScript(lua_State *L) { - wxLuaState wxlState(L); // const wxString script ! const wxString script = wxlState.GetwxStringType(2); // get this ! wxlCanObjAddScript * self = (wxlCanObjAddScript *)wxlState.GetUserDataType(1, s_wxluatag_wxlCanObjAddScript); // call SetScript self->SetScript(script); --- 328,335 ---- static int LUACALL wxLua_wxlCanObjAddScript_SetScript(lua_State *L) { // const wxString script ! const wxString script = wxlua_getwxstringtype(L, 2); // get this ! wxlCanObjAddScript * self = (wxlCanObjAddScript *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObjAddScript); // call SetScript self->SetScript(script); *************** *** 357,364 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxlCanObjAddScript *returns; // const wxString script ! const wxString script = wxlState.GetwxStringType(3); // double y double y = (double)wxlua_getnumbertype(L, 2); --- 345,351 ---- { wxluabind_removetableforcall(L); wxlCanObjAddScript *returns; // const wxString script ! const wxString script = wxlua_getwxstringtype(L, 3); // double y double y = (double)wxlua_getnumbertype(L, 2); *************** *** 368,372 **** returns = new wxlCanObjAddScript(x, y, script); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxlCanObjAddScript, returns); return 1; --- 355,359 ---- returns = new wxlCanObjAddScript(x, y, script); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjAddScript, returns); return 1; *************** *** 398,406 **** static int LUACALL wxLua_wxlCan_AddObject(lua_State *L) { - wxLuaState wxlState(L); // wxlCanObj canobj ! wxlCanObj * canobj = (wxlCanObj *)wxlState.GetUserDataType(2, s_wxluatag_wxlCanObj); // get this ! wxlCan * self = (wxlCan *)wxlState.GetUserDataType(1, s_wxluatag_wxlCan); // call AddObject self->AddObject(canobj); --- 385,392 ---- static int LUACALL wxLua_wxlCan_AddObject(lua_State *L) { // wxlCanObj canobj ! wxlCanObj * canobj = (wxlCanObj *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxlCanObj); // get this ! wxlCan * self = (wxlCan *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCan); // call AddObject self->AddObject(canobj); *************** *** 415,426 **** static int LUACALL wxLua_wxlCan_GetCmdh(lua_State *L) { - wxLuaState wxlState(L); wxlLuaCanCmd *returns; // get this ! wxlCan * self = (wxlCan *)wxlState.GetUserDataType(1, s_wxluatag_wxlCan); // call GetCmdh returns = (wxlLuaCanCmd *)self->GetCmdh(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxlLuaCanCmd, returns); return 1; --- 401,411 ---- 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); return 1; *************** *** 433,440 **** static int LUACALL wxLua_wxlCan_GetYaxis(lua_State *L) { - wxLuaState wxlState(L); bool returns; // get this ! wxlCan * self = (wxlCan *)wxlState.GetUserDataType(1, s_wxluatag_wxlCan); // call GetYaxis returns = (self->GetYaxis()); --- 418,424 ---- 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()); *************** *** 454,473 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxlCan *returns; // get number of arguments int argCount = lua_gettop(L); // const wxSize size = wxDefaultSize ! const wxSize * size = (argCount >= 4 ? (const wxSize *)wxlState.GetUserDataType(4, s_wxluatag_wxSize) : &wxDefaultSize); // const wxPoint pos = wxDefaultPosition ! const wxPoint * pos = (argCount >= 3 ? (const wxPoint *)wxlState.GetUserDataType(3, s_wxluatag_wxPoint) : &wxDefaultPosition); // wxWindowID id = -1 wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlua_getnumbertype(L, 2) : -1); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); // call constructor returns = new wxlCan(parent, id, *pos, *size); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxlCan, returns); return 1; --- 438,456 ---- { wxluabind_removetableforcall(L); wxlCan *returns; // get number of arguments int argCount = lua_gettop(L); // const wxSize size = wxDefaultSize ! const wxSize * size = (argCount >= 4 ? (const wxSize *)wxluaT_getuserdatatype(L, 4, s_wxluatag_wxSize) : &wxDefaultSize); // const wxPoint pos = wxDefaultPosition ! const wxPoint * pos = (argCount >= 3 ? (const wxPoint *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxPoint) : &wxDefaultPosition); // wxWindowID id = -1 wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlua_getnumbertype(L, 2) : -1); // wxWindow parent ! 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); return 1; *************** *** 507,511 **** static int LUACALL wxLua_wxlLuaCanCmd_MoveObject(lua_State *L) { - wxLuaState wxlState(L); // double y double y = (double)wxlua_getnumbertype(L, 4); --- 490,493 ---- *************** *** 515,519 **** int index = (int)wxlua_getnumbertype(L, 2); // get this ! wxlLuaCanCmd * self = (wxlLuaCanCmd *)wxlState.GetUserDataType(1, s_wxluatag_wxlLuaCanCmd); // call MoveObject self->MoveObject(index, x, y); --- 497,501 ---- int index = (int)wxlua_getnumbertype(L, 2); // get this ! wxlLuaCanCmd * self = (wxlLuaCanCmd *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlLuaCanCmd); // call MoveObject self->MoveObject(index, x, y); *************** *** 529,533 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxlLuaCanCmd *returns; // get number of arguments --- 511,514 ---- *************** *** 536,544 **** int maxCommands = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : -1); // wxlCan canvas ! wxlCan * canvas = (wxlCan *)wxlState.GetUserDataType(1, s_wxluatag_wxlCan); // call constructor returns = new wxlLuaCanCmd(canvas, maxCommands); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxlLuaCanCmd, returns); return 1; --- 517,525 ---- int maxCommands = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : -1); // wxlCan canvas ! 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); return 1; Index: wxluacan_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_bind.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wxluacan_bind.cpp 17 Nov 2007 00:14:53 -0000 1.25 --- wxluacan_bind.cpp 7 Dec 2007 02:13:09 -0000 1.26 *************** *** 88,97 **** static int LUACALL wxLua_function_GetCan(lua_State *L) { - wxLuaState wxlState(L); wxlCan *returns; // call GetCan returns = (wxlCan *)GetCan(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxlCan, returns); return 1; --- 88,96 ---- 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); return 1; *************** *** 102,111 **** static int LUACALL wxLua_function_GetCmdhMain(lua_State *L) { - wxLuaState wxlState(L); wxlLuaCanCmd *returns; // call GetCmdhMain returns = (wxlLuaCanCmd *)GetCmdhMain(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxlLuaCanCmd, returns); return 1; --- 101,109 ---- 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); return 1; Index: wxluacan.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wxluacan.h 17 Nov 2007 00:14:53 -0000 1.35 --- wxluacan.h 7 Dec 2007 02:13:09 -0000 1.36 *************** *** 18,24 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 18 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 18 // --------------------------------------------------------------------------- --- 18,24 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 19 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 19 // --------------------------------------------------------------------------- |
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12976/wxLua/modules/wxbind/src Modified Files: wxadv_adv.cpp wxadv_bind.cpp wxadv_grid.cpp wxaui_aui.cpp wxbase_base.cpp wxbase_bind.cpp wxbase_config.cpp wxbase_data.cpp wxbase_datetime.cpp wxbase_file.cpp wxcore_appframe.cpp wxcore_bind.cpp wxcore_clipdrag.cpp wxcore_controls.cpp wxcore_core.cpp wxcore_defsutils.cpp wxcore_dialogs.cpp wxcore_event.cpp wxcore_gdi.cpp wxcore_geometry.cpp wxcore_help.cpp wxcore_image.cpp wxcore_mdi.cpp wxcore_menutool.cpp wxcore_picker.cpp wxcore_print.cpp wxcore_sizer.cpp wxcore_windows.cpp wxgl_gl.cpp wxhtml_html.cpp wxmedia_media.cpp wxnet_net.cpp wxstc_stc.cpp wxxml_xml.cpp wxxrc_xrc.cpp Log Message: Too many changes to list... A large portion of the internal workings of the wxLuaState have been rewritten. All of the data that was stored in wxLuaStateData that might be needed by a function taking a lua_State* is now in the LUA_REGISTRYINDEX. C functions have been added to access these values. The generated bindings no longer need to have "wxLuaState wxlState(L);" since everything can be done with the C functions. The result is that wxLua should be faster. Index: wxnet_net.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxnet_net.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxnet_net.cpp 1 Aug 2007 19:15:37 -0000 1.3 --- wxnet_net.cpp 7 Dec 2007 02:13:14 -0000 1.4 *************** *** 35,41 **** static int LUACALL wxLua_wxSocketBase_Close(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxSocketBase * self = (wxSocketBase *)wxlState.GetUserDataType(1, s_wxluatag_wxSocketBase); // call Close self->Close(); --- 35,40 ---- static int LUACALL wxLua_wxSocketBase_Close(lua_State *L) { [...3024 lines suppressed...] return 1; *************** *** 3096,3103 **** static int LUACALL wxLua_wxURL_constructor_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "wxURL", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxURL_constructor_overload, s_wxluafunc_wxLua_wxURL_constructor_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } #endif // (((wxLUA_USE_wxSocket && wxUSE_SOCKETS) && (wxUSE_URL)) && (wxLUA_USE_wxSocket && wxUSE_SOCKETS))||((wxLUA_USE_wxSocket && wxUSE_SOCKETS) && (wxUSE_URL)) --- 2959,2965 ---- static int LUACALL wxLua_wxURL_constructor_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "wxURL", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxURL_constructor_overload, s_wxluafunc_wxLua_wxURL_constructor_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } #endif // (((wxLUA_USE_wxSocket && wxUSE_SOCKETS) && (wxUSE_URL)) && (wxLUA_USE_wxSocket && wxUSE_SOCKETS))||((wxLUA_USE_wxSocket && wxUSE_SOCKETS) && (wxUSE_URL)) Index: wxstc_stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxstc_stc.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxstc_stc.cpp 17 Nov 2007 00:15:00 -0000 1.4 --- wxstc_stc.cpp 7 Dec 2007 02:13:14 -0000 1.5 *************** *** 33,41 **** static int LUACALL wxLua_wxStyledTextCtrl_AddRefDocument(lua_State *L) { - wxLuaState wxlState(L); // void docPointer ! void * docPointer = (void *)wxlState.wxlua_ToUserdata(2); // get this ! wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); // call AddRefDocument self->AddRefDocument(docPointer); --- 33,40 ---- [...9582 lines suppressed...] wxStyledTextEvent *returns; // get number of arguments --- 8861,8864 ---- *************** *** 9361,9367 **** returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxStyledTextEvent, returns); return 1; --- 8871,8877 ---- returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxStyledTextEvent, returns); return 1; Index: wxxrc_xrc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxrc_xrc.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxxrc_xrc.cpp 1 Aug 2007 19:15:37 -0000 1.3 --- wxxrc_xrc.cpp 7 Dec 2007 02:13:14 -0000 1.4 *************** *** 35,50 **** static int LUACALL wxLua_wxXmlResource_AttachUnknownControl(lua_State *L) { - wxLuaState wxlState(L); bool returns; // get number of arguments int argCount = lua_gettop(L); // wxWindow parent = NULL ! wxWindow * parent = (argCount >= 4 ? (wxWindow *)wxlState.GetUserDataType(4, s_wxluatag_wxWindow) : NULL); // wxWindow control ! wxWindow * control = (wxWindow *)wxlState.GetUserDataType(3, s_wxluatag_wxWindow); // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call AttachUnknownControl returns = (self->AttachUnknownControl(name, control, parent)); --- 35,49 ---- static int LUACALL wxLua_wxXmlResource_AttachUnknownControl(lua_State *L) { bool returns; // get number of arguments int argCount = lua_gettop(L); // wxWindow parent = NULL ! wxWindow * parent = (argCount >= 4 ? (wxWindow *)wxluaT_getuserdatatype(L, 4, s_wxluatag_wxWindow) : NULL); // wxWindow control ! wxWindow * control = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call AttachUnknownControl returns = (self->AttachUnknownControl(name, control, parent)); *************** *** 61,67 **** static int LUACALL wxLua_wxXmlResource_ClearHandlers(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call ClearHandlers self->ClearHandlers(); --- 60,65 ---- static int LUACALL wxLua_wxXmlResource_ClearHandlers(lua_State *L) { // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call ClearHandlers self->ClearHandlers(); *************** *** 76,80 **** static int LUACALL wxLua_wxXmlResource_CompareVersion(lua_State *L) { - wxLuaState wxlState(L); int returns; // int revision --- 74,77 ---- *************** *** 87,91 **** int major = (int)wxlua_getnumbertype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call CompareVersion returns = (self->CompareVersion(major, minor, release, revision)); --- 84,88 ---- int major = (int)wxlua_getnumbertype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call CompareVersion returns = (self->CompareVersion(major, minor, release, revision)); *************** *** 101,110 **** static int LUACALL wxLua_wxXmlResource_Get(lua_State *L) { - wxLuaState wxlState(L); wxXmlResource *returns; // call Get returns = (wxXmlResource *)wxXmlResource::Get(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); return 1; --- 98,106 ---- static int LUACALL wxLua_wxXmlResource_Get(lua_State *L) { wxXmlResource *returns; // call Get returns = (wxXmlResource *)wxXmlResource::Get(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); return 1; *************** *** 117,124 **** static int LUACALL wxLua_wxXmlResource_GetFlags(lua_State *L) { - wxLuaState wxlState(L); int returns; // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call GetFlags returns = (self->GetFlags()); --- 113,119 ---- static int LUACALL wxLua_wxXmlResource_GetFlags(lua_State *L) { int returns; // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call GetFlags returns = (self->GetFlags()); *************** *** 135,142 **** static int LUACALL wxLua_wxXmlResource_GetVersion(lua_State *L) { - wxLuaState wxlState(L); long returns; // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call GetVersion returns = (self->GetVersion()); --- 130,136 ---- static int LUACALL wxLua_wxXmlResource_GetVersion(lua_State *L) { long returns; // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call GetVersion returns = (self->GetVersion()); *************** *** 153,157 **** static int LUACALL wxLua_wxXmlResource_GetXRCID(lua_State *L) { - wxLuaState wxlState(L); int returns; // get number of arguments --- 147,150 ---- *************** *** 160,164 **** int value_if_not_found = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxID_NONE); // const wxString stringID ! const wxString stringID = wxlState.GetwxStringType(1); // call GetXRCID returns = (wxXmlResource::GetXRCID(stringID, value_if_not_found)); --- 153,157 ---- int value_if_not_found = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxID_NONE); // const wxString stringID ! const wxString stringID = wxlua_getwxstringtype(L, 1); // call GetXRCID returns = (wxXmlResource::GetXRCID(stringID, value_if_not_found)); *************** *** 175,181 **** static int LUACALL wxLua_wxXmlResource_InitAllHandlers(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call InitAllHandlers self->InitAllHandlers(); --- 168,173 ---- static int LUACALL wxLua_wxXmlResource_InitAllHandlers(lua_State *L) { // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call InitAllHandlers self->InitAllHandlers(); *************** *** 190,199 **** static int LUACALL wxLua_wxXmlResource_Load(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString filemask ! const wxString filemask = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call Load returns = (self->Load(filemask)); --- 182,190 ---- static int LUACALL wxLua_wxXmlResource_Load(lua_State *L) { bool returns; // const wxString filemask ! const wxString filemask = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call Load returns = (self->Load(filemask)); *************** *** 212,228 **** static int LUACALL wxLua_wxXmlResource_LoadBitmap(lua_State *L) { - wxLuaState wxlState(L); wxBitmap *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadBitmap // allocate a new object using the copy constructor returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxBitmap *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); return 1; --- 203,218 ---- static int LUACALL wxLua_wxXmlResource_LoadBitmap(lua_State *L) { wxBitmap *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadBitmap // allocate a new object using the copy constructor returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxBitmap *)returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxBitmap, returns); return 1; *************** *** 238,251 **** static int LUACALL wxLua_wxXmlResource_LoadDialog1(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(3, s_wxluatag_wxWindow); // wxDialog dlg ! wxDialog * dlg = (wxDialog *)wxlState.GetUserDataType(2, s_wxluatag_wxDialog); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadDialog returns = (self->LoadDialog(dlg, parent, name)); --- 228,240 ---- static int LUACALL wxLua_wxXmlResource_LoadDialog1(lua_State *L) { bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // wxDialog dlg ! wxDialog * dlg = (wxDialog *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDialog); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadDialog returns = (self->LoadDialog(dlg, parent, name)); *************** *** 262,277 **** static int LUACALL wxLua_wxXmlResource_LoadDialog(lua_State *L) { - wxLuaState wxlState(L); wxDialog *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadDialog returns = (wxDialog *)self->LoadDialog(parent, name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxDialog, returns); return 1; --- 251,265 ---- static int LUACALL wxLua_wxXmlResource_LoadDialog(lua_State *L) { wxDialog *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadDialog returns = (wxDialog *)self->LoadDialog(parent, name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxDialog, returns); return 1; *************** *** 287,300 **** static int LUACALL wxLua_wxXmlResource_LoadFrame(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(3, s_wxluatag_wxWindow); // wxFrame frame ! wxFrame * frame = (wxFrame *)wxlState.GetUserDataType(2, s_wxluatag_wxFrame); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadFrame returns = (self->LoadFrame(frame, parent, name)); --- 275,287 ---- static int LUACALL wxLua_wxXmlResource_LoadFrame(lua_State *L) { bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // wxFrame frame ! wxFrame * frame = (wxFrame *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxFrame); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadFrame returns = (self->LoadFrame(frame, parent, name)); *************** *** 314,330 **** static int LUACALL wxLua_wxXmlResource_LoadIcon(lua_State *L) { - wxLuaState wxlState(L); wxIcon *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadIcon // allocate a new object using the copy constructor returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxIcon *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxIcon, returns); return 1; --- 301,316 ---- static int LUACALL wxLua_wxXmlResource_LoadIcon(lua_State *L) { wxIcon *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadIcon // allocate a new object using the copy constructor returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxIcon *)returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxIcon, returns); return 1; *************** *** 340,353 **** static int LUACALL wxLua_wxXmlResource_LoadMenu(lua_State *L) { - wxLuaState wxlState(L); wxMenu *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadMenu returns = (wxMenu *)self->LoadMenu(name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxMenu, returns); return 1; --- 326,338 ---- static int LUACALL wxLua_wxXmlResource_LoadMenu(lua_State *L) { wxMenu *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenu returns = (wxMenu *)self->LoadMenu(name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxMenu, returns); return 1; *************** *** 360,373 **** static int LUACALL wxLua_wxXmlResource_LoadMenuBar1(lua_State *L) { - wxLuaState wxlState(L); wxMenuBar *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadMenuBar returns = (wxMenuBar *)self->LoadMenuBar(name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxMenuBar, returns); return 1; --- 345,357 ---- static int LUACALL wxLua_wxXmlResource_LoadMenuBar1(lua_State *L) { wxMenuBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenuBar returns = (wxMenuBar *)self->LoadMenuBar(name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxMenuBar, returns); return 1; *************** *** 380,395 **** static int LUACALL wxLua_wxXmlResource_LoadMenuBar(lua_State *L) { - wxLuaState wxlState(L); wxMenuBar *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadMenuBar returns = (wxMenuBar *)self->LoadMenuBar(parent, name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxMenuBar, returns); return 1; --- 364,378 ---- static int LUACALL wxLua_wxXmlResource_LoadMenuBar(lua_State *L) { wxMenuBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenuBar returns = (wxMenuBar *)self->LoadMenuBar(parent, name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxMenuBar, returns); return 1; *************** *** 404,417 **** static int LUACALL wxLua_wxXmlResource_LoadPanel1(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(3, s_wxluatag_wxWindow); // wxPanel panel ! wxPanel * panel = (wxPanel *)wxlState.GetUserDataType(2, s_wxluatag_wxPanel); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadPanel returns = (self->LoadPanel(panel, parent, name)); --- 387,399 ---- static int LUACALL wxLua_wxXmlResource_LoadPanel1(lua_State *L) { bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // wxPanel panel ! wxPanel * panel = (wxPanel *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxPanel); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadPanel returns = (self->LoadPanel(panel, parent, name)); *************** *** 428,443 **** static int LUACALL wxLua_wxXmlResource_LoadPanel(lua_State *L) { - wxLuaState wxlState(L); wxPanel *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadPanel returns = (wxPanel *)self->LoadPanel(parent, name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxPanel, returns); return 1; --- 410,424 ---- static int LUACALL wxLua_wxXmlResource_LoadPanel(lua_State *L) { wxPanel *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadPanel returns = (wxPanel *)self->LoadPanel(parent, name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxPanel, returns); return 1; *************** *** 452,467 **** static int LUACALL wxLua_wxXmlResource_LoadToolBar(lua_State *L) { - wxLuaState wxlState(L); wxToolBar *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadToolBar returns = (wxToolBar *)self->LoadToolBar(parent, name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxToolBar, returns); return 1; --- 433,447 ---- static int LUACALL wxLua_wxXmlResource_LoadToolBar(lua_State *L) { wxToolBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadToolBar returns = (wxToolBar *)self->LoadToolBar(parent, name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxToolBar, returns); return 1; *************** *** 476,489 **** static int LUACALL wxLua_wxXmlResource_Set(lua_State *L) { - wxLuaState wxlState(L); wxXmlResource *returns; // wxXmlResource res ! wxXmlResource * res = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); ! if (wxlState.IsTrackedObject(res)) wxlState.RemoveTrackedObject(res, wxLuaState::UNDELETE_OBJECT); // call Set returns = (wxXmlResource *)wxXmlResource::Set(res); ! if (!wxlState.IsTrackedObject(returns)) wxlState.AddTrackedObject(returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); return 1; --- 456,468 ---- static int LUACALL wxLua_wxXmlResource_Set(lua_State *L) { wxXmlResource *returns; // wxXmlResource res ! wxXmlResource * res = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); ! if (wxluaO_istrackedobject(L, res)) wxluaO_removetrackedobject(L, res, wxLUA_UNDELETE_OBJECT); // call Set returns = (wxXmlResource *)wxXmlResource::Set(res); ! if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); return 1; *************** *** 496,504 **** static int LUACALL wxLua_wxXmlResource_SetDomain(lua_State *L) { - wxLuaState wxlState(L); // const wxString domain ! const wxString domain = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call SetDomain self->SetDomain(domain); --- 475,482 ---- static int LUACALL wxLua_wxXmlResource_SetDomain(lua_State *L) { // const wxString domain ! const wxString domain = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call SetDomain self->SetDomain(domain); *************** *** 513,521 **** static int LUACALL wxLua_wxXmlResource_SetFlags(lua_State *L) { - wxLuaState wxlState(L); // int flags int flags = (int)wxlua_getnumbertype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call SetFlags self->SetFlags(flags); --- 491,498 ---- static int LUACALL wxLua_wxXmlResource_SetFlags(lua_State *L) { // int flags int flags = (int)wxlua_getnumbertype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call SetFlags self->SetFlags(flags); *************** *** 530,539 **** static int LUACALL wxLua_wxXmlResource_Unload(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString filename ! const wxString filename = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call Unload returns = (self->Unload(filename)); --- 507,515 ---- static int LUACALL wxLua_wxXmlResource_Unload(lua_State *L) { bool returns; // const wxString filename ! const wxString filename = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call Unload returns = (self->Unload(filename)); *************** *** 549,556 **** static int LUACALL wxLua_wxXmlResource_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 525,531 ---- static int LUACALL wxLua_wxXmlResource_delete(lua_State *L) { ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 567,586 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxXRC_USE_LOCALE); // const wxString filemask ! const wxString filemask = wxlState.GetwxStringType(1); // call constructor returns = new wxXmlResource(filemask, flags, domain); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); return 1; --- 542,560 ---- { wxluabind_removetableforcall(L); wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 3 ? wxlua_getwxstringtype(L, 3) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxXRC_USE_LOCALE); // const wxString filemask ! const wxString filemask = wxlua_getwxstringtype(L, 1); // call constructor returns = new wxXmlResource(filemask, flags, domain); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); return 1; *************** *** 594,603 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxXRC_USE_LOCALE); --- 568,576 ---- { wxluabind_removetableforcall(L); wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 2 ? wxlua_getwxstringtype(L, 2) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxXRC_USE_LOCALE); *************** *** 605,611 **** returns = new wxXmlResource(flags, domain); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); return 1; --- 578,584 ---- returns = new wxXmlResource(flags, domain); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); return 1; *************** *** 634,641 **** static int LUACALL wxLua_wxXmlResource_LoadDialog_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "LoadDialog", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadDialog_overload, s_wxluafunc_wxLua_wxXmlResource_LoadDialog_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } #endif // ((wxLUA_USE_wxDialog) && (wxLUA_USE_wxXRC && wxUSE_XRC)) --- 607,613 ---- static int LUACALL wxLua_wxXmlResource_LoadDialog_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "LoadDialog", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadDialog_overload, s_wxluafunc_wxLua_wxXmlResource_LoadDialog_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } #endif // ((wxLUA_USE_wxDialog) && (wxLUA_USE_wxXRC && wxUSE_XRC)) *************** *** 660,667 **** static int LUACALL wxLua_wxXmlResource_LoadMenuBar_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "LoadMenuBar", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadMenuBar_overload, s_wxluafunc_wxLua_wxXmlResource_LoadMenuBar_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } #endif // ((wxLUA_USE_wxMenu && wxUSE_MENUS) && (wxLUA_USE_wxXRC && wxUSE_XRC)) --- 632,638 ---- static int LUACALL wxLua_wxXmlResource_LoadMenuBar_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "LoadMenuBar", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadMenuBar_overload, s_wxluafunc_wxLua_wxXmlResource_LoadMenuBar_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } #endif // ((wxLUA_USE_wxMenu && wxUSE_MENUS) && (wxLUA_USE_wxXRC && wxUSE_XRC)) *************** *** 680,687 **** static int LUACALL wxLua_wxXmlResource_LoadPanel_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "LoadPanel", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadPanel_overload, s_wxluafunc_wxLua_wxXmlResource_LoadPanel_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } static int LUACALL wxLua_wxXmlResource_constructor_overload(lua_State *L); --- 651,657 ---- static int LUACALL wxLua_wxXmlResource_LoadPanel_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "LoadPanel", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadPanel_overload, s_wxluafunc_wxLua_wxXmlResource_LoadPanel_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } static int LUACALL wxLua_wxXmlResource_constructor_overload(lua_State *L); *************** *** 697,704 **** static int LUACALL wxLua_wxXmlResource_constructor_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "wxXmlResource", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxXmlResource_constructor_overload, s_wxluafunc_wxLua_wxXmlResource_constructor_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } #endif // (wxLUA_USE_wxXRC && wxUSE_XRC) --- 667,673 ---- static int LUACALL wxLua_wxXmlResource_constructor_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "wxXmlResource", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxXmlResource_constructor_overload, s_wxluafunc_wxLua_wxXmlResource_constructor_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } #endif // (wxLUA_USE_wxXRC && wxUSE_XRC) Index: wxcore_core.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_core.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxcore_core.cpp 1 Aug 2007 19:15:35 -0000 1.3 --- wxcore_core.cpp 7 Dec 2007 02:13:12 -0000 1.4 *************** *** 40,47 **** static int LUACALL wxLua_wxLogGui_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxLogGui * self = (wxLogGui *)wxlState.GetUserDataType(1, s_wxluatag_wxLogGui); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 40,46 ---- static int LUACALL wxLua_wxLogGui_delete(lua_State *L) { ! wxLogGui * self = (wxLogGui *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogGui); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 57,68 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxLogGui *returns; // call constructor returns = new wxLogGui(); // add to tracked memory list ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxLogGui((wxLogGui *)returns)); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLogGui, returns); return 1; --- 56,66 ---- { wxluabind_removetableforcall(L); wxLogGui *returns; // call constructor returns = new wxLogGui(); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogGui((wxLogGui *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxLogGui, returns); return 1; *************** *** 98,105 **** static int LUACALL wxLua_wxLogTextCtrl_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxLogTextCtrl * self = (wxLogTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxLogTextCtrl); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 96,102 ---- static int LUACALL wxLua_wxLogTextCtrl_delete(lua_State *L) { ! wxLogTextCtrl * self = (wxLogTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogTextCtrl); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 118,131 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxLogTextCtrl *returns; // wxTextCtrl textCtrl ! wxTextCtrl * textCtrl = (wxTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxTextCtrl); // call constructor returns = new wxLogTextCtrl(textCtrl); // add to tracked memory list ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxLogTextCtrl((wxLogTextCtrl *)returns)); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLogTextCtrl, returns); return 1; --- 115,127 ---- { wxluabind_removetableforcall(L); wxLogTextCtrl *returns; // wxTextCtrl textCtrl ! wxTextCtrl * textCtrl = (wxTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextCtrl); // call constructor returns = new wxLogTextCtrl(textCtrl); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogTextCtrl((wxLogTextCtrl *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxLogTextCtrl, returns); return 1; *************** *** 167,178 **** static int LUACALL wxLua_wxLogWindow_GetFrame(lua_State *L) { - wxLuaState wxlState(L); wxFrame *returns; // get this ! wxLogWindow * self = (wxLogWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxLogWindow); // call GetFrame returns = (wxFrame *)self->GetFrame(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxFrame, returns); return 1; --- 163,173 ---- static int LUACALL wxLua_wxLogWindow_GetFrame(lua_State *L) { wxFrame *returns; // get this ! wxLogWindow * self = (wxLogWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogWindow); // call GetFrame returns = (wxFrame *)self->GetFrame(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxFrame, returns); return 1; *************** *** 187,191 **** static int LUACALL wxLua_wxLogWindow_Show(lua_State *L) { - wxLuaState wxlState(L); // get number of arguments int argCount = lua_gettop(L); --- 182,185 ---- *************** *** 193,197 **** bool show = (argCount >= 2 ? wxlua_getbooleantype(L, 2) : true); // get this ! wxLogWindow * self = (wxLogWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxLogWindow); // call Show self->Show(show); --- 187,191 ---- bool show = (argCount >= 2 ? wxlua_getbooleantype(L, 2) : true); // get this ! wxLogWindow * self = (wxLogWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogWindow); // call Show self->Show(show); *************** *** 205,212 **** static int LUACALL wxLua_wxLogWindow_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxLogWindow * self = (wxLogWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxLogWindow); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 199,205 ---- static int LUACALL wxLua_wxLogWindow_delete(lua_State *L) { ! wxLogWindow * self = (wxLogWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogWindow); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 223,227 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxLogWindow *returns; // get number of arguments --- 216,219 ---- *************** *** 232,244 **** bool bShow = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : true); // const wxString szTitle ! const wxString szTitle = wxlState.GetwxStringType(2); // wxWindow pParent ! wxWindow * pParent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); // call constructor returns = new wxLogWindow(pParent, szTitle, bShow, bPassToOld); // add to tracked memory list ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxLogWindow((wxLogWindow *)returns)); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLogWindow, returns); return 1; --- 224,236 ---- bool bShow = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : true); // const wxString szTitle ! const wxString szTitle = wxlua_getwxstringtype(L, 2); // wxWindow pParent ! wxWindow * pParent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor returns = new wxLogWindow(pParent, szTitle, bShow, bPassToOld); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogWindow((wxLogWindow *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxLogWindow, returns); return 1; *************** *** 281,285 **** static int LUACALL wxLua_wxSystemSettings_GetColour(lua_State *L) { - wxLuaState wxlState(L); wxColour *returns; // wxSystemColour index --- 273,276 ---- *************** *** 289,295 **** returns = new wxColour(wxSystemSettings::GetColour(index)); // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxColour *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxColour, returns); return 1; --- 280,286 ---- returns = new wxColour(wxSystemSettings::GetColour(index)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxColour *)returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); return 1; *************** *** 305,309 **** static int LUACALL wxLua_wxSystemSettings_GetFont(lua_State *L) { - wxLuaState wxlState(L); wxFont *returns; // wxSystemFont index --- 296,299 ---- *************** *** 313,319 **** returns = new wxFont(wxSystemSettings::GetFont(index)); // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxFont *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxFont, returns); return 1; --- 303,309 ---- returns = new wxFont(wxSystemSettings::GetFont(index)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxFont *)returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxFont, returns); return 1; *************** *** 328,337 **** static int LUACALL wxLua_wxSystemSettings_GetMetric(lua_State *L) { - wxLuaState wxlState(L); int returns; // get number of arguments int argCount = lua_gettop(L); // wxWindow win = NULL ! wxWindow * win = (argCount >= 2 ? (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow) : NULL); // wxSystemMetric index wxSystemMetric index = (wxSystemMetric)wxlua_getintegertype(L, 1); --- 318,326 ---- static int LUACALL wxLua_wxSystemSettings_GetMetric(lua_State *L) { int returns; // get number of arguments int argCount = lua_gettop(L); // wxWindow win = NULL ! wxWindow * win = (argCount >= 2 ? (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow) : NULL); // wxSystemMetric index wxSystemMetric index = (wxSystemMetric)wxlua_getintegertype(L, 1); *************** *** 429,440 **** static int LUACALL wxLua_wxValidator_GetWindow(lua_State *L) { - wxLuaState wxlState(L); wxWindow *returns; // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call GetWindow returns = (wxWindow *)self->GetWindow(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxWindow, returns); return 1; --- 418,428 ---- static int LUACALL wxLua_wxValidator_GetWindow(lua_State *L) { wxWindow *returns; // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call GetWindow returns = (wxWindow *)self->GetWindow(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxWindow, returns); return 1; *************** *** 477,485 **** static int LUACALL wxLua_wxValidator_SetWindow(lua_State *L) { - wxLuaState wxlState(L); // wxWindow window ! wxWindow * window = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call SetWindow self->SetWindow(window); --- 465,472 ---- static int LUACALL wxLua_wxValidator_SetWindow(lua_State *L) { // wxWindow window ! wxWindow * window = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call SetWindow self->SetWindow(window); *************** *** 494,501 **** static int LUACALL wxLua_wxValidator_TransferFromWindow(lua_State *L) { - wxLuaState wxlState(L); bool returns; // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call TransferFromWindow returns = (self->TransferFromWindow()); --- 481,487 ---- static int LUACALL wxLua_wxValidator_TransferFromWindow(lua_State *L) { bool returns; // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call TransferFromWindow returns = (self->TransferFromWindow()); *************** *** 512,519 **** static int LUACALL wxLua_wxValidator_TransferToWindow(lua_State *L) { - wxLuaState wxlState(L); bool returns; // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call TransferToWindow returns = (self->TransferToWindow()); --- 498,504 ---- static int LUACALL wxLua_wxValidator_TransferToWindow(lua_State *L) { bool returns; // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call TransferToWindow returns = (self->TransferToWindow()); *************** *** 530,539 **** static int LUACALL wxLua_wxValidator_Validate(lua_State *L) { - wxLuaState wxlState(L); bool returns; // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call Validate returns = (self->Validate(parent)); --- 515,523 ---- static int LUACALL wxLua_wxValidator_Validate(lua_State *L) { bool returns; // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call Validate returns = (self->Validate(parent)); *************** *** 580,591 **** static int LUACALL wxLua_wxTextValidator_GetExcludes(lua_State *L) { - wxLuaState wxlState(L); wxArrayString *returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call GetExcludes returns = &self->GetExcludes(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxArrayString, returns); return 1; --- 564,574 ---- static int LUACALL wxLua_wxTextValidator_GetExcludes(lua_State *L) { wxArrayString *returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call GetExcludes returns = &self->GetExcludes(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxArrayString, returns); return 1; *************** *** 598,609 **** static int LUACALL wxLua_wxTextValidator_GetIncludes(lua_State *L) { - wxLuaState wxlState(L); wxArrayString *returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call GetIncludes returns = &self->GetIncludes(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxArrayString, returns); return 1; --- 581,591 ---- static int LUACALL wxLua_wxTextValidator_GetIncludes(lua_State *L) { wxArrayString *returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call GetIncludes returns = &self->GetIncludes(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxArrayString, returns); return 1; *************** *** 618,625 **** static int LUACALL wxLua_wxTextValidator_GetStyle(lua_State *L) { - wxLuaState wxlState(L); long returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call GetStyle returns = (self->GetStyle()); --- 600,606 ---- static int LUACALL wxLua_wxTextValidator_GetStyle(lua_State *L) { long returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call GetStyle returns = (self->GetStyle()); *************** *** 638,646 **** static int LUACALL wxLua_wxTextValidator_SetExcludes(lua_State *L) { - wxLuaState wxlState(L); // const wxArrayString excludes ! wxArrayString excludes = wxArrayString(); wxlState.GetwxArrayString(2, excludes); // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetExcludes self->SetExcludes(excludes); --- 619,626 ---- static int LUACALL wxLua_wxTextValidator_SetExcludes(lua_State *L) { // const wxArrayString excludes ! wxLuaSmartwxArrayString excludes = wxlua_getwxArrayString(L, 2); // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call SetExcludes self->SetExcludes(excludes); *************** *** 655,663 **** static int LUACALL wxLua_wxTextValidator_SetIncludes(lua_State *L) { - wxLuaState wxlState(L); // const wxArrayString includes ! wxArrayString includes = wxArrayString(); wxlState.GetwxArrayString(2, includes); // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetIncludes self->SetIncludes(includes); --- 635,642 ---- static int LUACALL wxLua_wxTextValidator_SetIncludes(lua_State *L) { // const wxArrayString includes ! wxLuaSmartwxArrayString includes = wxlua_getwxArrayString(L, 2); // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call SetIncludes self->SetIncludes(includes); *************** *** 674,682 **** static int LUACALL wxLua_wxTextValidator_SetStyle(lua_State *L) { - wxLuaState wxlState(L); // long style long style = (long)wxlua_getnumbertype(L, 2); // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetStyle self->SetStyle(style); --- 653,660 ---- static int LUACALL wxLua_wxTextValidator_SetStyle(lua_State *L) { // long style long style = (long)wxlua_getnumbertype(L, 2); // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call SetStyle self->SetStyle(style); *************** *** 690,697 **** static int LUACALL wxLua_wxTextValidator_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 668,674 ---- static int LUACALL wxLua_wxTextValidator_delete(lua_State *L) { ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 709,723 **** { wxluabind_removetableforcall(L); ! wxLuaState wxlState(L); wxTextValidator *returns; // get number of arguments int argCount = lua_gettop(L); // long style = wxFILTER_NONE ! long style = (argCount >= 1 ? (long)wxlState.GetNumberType(1) : wxFILTER_NONE); // call constructor if (argCount >= 2) { ! wxLuaObject *valPtr = (wxLuaObject *)wxlState.GetUserDataType(2, s_wxluatag_wxLuaObject); returns = new wxTextValidator(style, valPtr->GetStringPtr()); } --- 686,700 ---- { wxluabind_removetableforcall(L); ! wxTextValidator *returns; // get number of arguments int argCount = lua_gettop(L); // long style = wxFILTER_NONE ! long style = (argCount >= 1 ? (long)wxlua_getintegertype(L, 1) : wxFILTER_NONE); // call constructor if (argCount >= 2) { ! wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxLuaObject); returns = new wxTextValidator(style, valPtr->GetStringPtr()); } *************** *** 726,730 **** // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxTextValidator, returns); // return the number of parameters return 1; --- 703,707 ---- // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxTextValidator, returns); // return the number of parameters return 1; *************** *** 774,781 **** static int LUACALL wxLua_wxGenericValidator_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxGenericValidator * self = (wxGenericValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericValidator); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 751,757 ---- static int LUACALL wxLua_wxGenericValidator_delete(lua_State *L) { ! wxGenericValidator * self = (wxGenericValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGenericValidator); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 793,806 **** { wxluabind_removetableforcall(L); ! wxLuaState wxlState(L); wxGenericValidator *returns; // wxLuaObject *valPtr ! wxLuaObject *valPtr = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call constructor returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); // return the number of parameters return 1; --- 769,782 ---- { wxluabind_removetableforcall(L); ! wxGenericValidator *returns; // wxLuaObject *valPtr ! wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); // call constructor returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxGeneri... [truncated message content] |