From: John L. <jr...@us...> - 2006-12-14 01:01:56
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/bindings/wxwidgets Modified Files: override.hpp Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/override.hpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** override.hpp 6 Nov 2006 06:11:43 -0000 1.56 --- override.hpp 14 Dec 2006 01:01:23 -0000 1.57 *************** *** 190,194 **** if (returns != NULL) { ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxAcceleratorTable, returns); --- 190,194 ---- if (returns != NULL) { ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxAcceleratorTable, returns); *************** *** 854,858 **** returns = new wxTreeItemId(self->GetFirstChild(*item, cookie)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); --- 854,858 ---- returns = new wxTreeItemId(self->GetFirstChild(*item, cookie)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); *************** *** 889,893 **** returns = new wxTreeItemId(self->GetNextChild(*item, cookie)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); --- 889,893 ---- returns = new wxTreeItemId(self->GetNextChild(*item, cookie)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); *************** *** 944,948 **** returns = new wxTreeItemId(self->HitTest(*point, flags)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the result datatype --- 944,948 ---- returns = new wxTreeItemId(self->HitTest(*point, flags)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the result datatype *************** *** 971,975 **** returns = new wxString(str); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxString, returns); --- 971,975 ---- returns = new wxString(str); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxString, returns); *************** *** 1154,1158 **** returns = new wxGenericValidator(boolPtr->GetBoolPtr()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); --- 1154,1158 ---- returns = new wxGenericValidator(boolPtr->GetBoolPtr()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); *************** *** 1173,1177 **** returns = new wxGenericValidator(valPtr->GetStringPtr()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); --- 1173,1177 ---- returns = new wxGenericValidator(valPtr->GetStringPtr()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); *************** *** 1192,1196 **** returns = new wxGenericValidator(valPtr->GetIntPtr()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); --- 1192,1196 ---- returns = new wxGenericValidator(valPtr->GetIntPtr()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); *************** *** 1211,1215 **** returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); --- 1211,1215 ---- returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); *************** *** 1473,1477 **** returns = new wxBusyCursor(cursor); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxBusyCursor *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); --- 1473,1477 ---- returns = new wxBusyCursor(cursor); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxBusyCursor *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); *************** *** 1583,1587 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxSingleChoiceDialog, returns); --- 1583,1587 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxSingleChoiceDialog, returns); *************** *** 1693,1699 **** wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! int winId = wxID_ANY; ! int lastId = wxID_ANY; ! int eventType = 0; wxLuaCallback *pCallback = NULL; --- 1693,1699 ---- wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! wxWindowID winId = wxID_ANY; ! wxWindowID lastId = wxID_ANY; ! wxEventType eventType = 0; wxLuaCallback *pCallback = NULL; *************** *** 1713,1717 **** if (wxlState.IsEnumerationType(3)) ! lastId = (int)lua_tonumber(L, 3); else { --- 1713,1717 ---- if (wxlState.IsEnumerationType(3)) ! lastId = (wxWindowID)lua_tonumber(L, 3); else { *************** *** 1722,1726 **** if (wxlState.IsEnumerationType(2)) ! winId = (int)lua_tonumber(L, 2); else { --- 1722,1726 ---- if (wxlState.IsEnumerationType(2)) ! winId = (wxWindowID)lua_tonumber(L, 2); else { *************** *** 1738,1742 **** if (wxlState.IsEnumerationType(2)) ! winId = (int)lua_tonumber(L, 2); else { --- 1738,1742 ---- if (wxlState.IsEnumerationType(2)) ! winId = (wxWindowID)lua_tonumber(L, 2); else { *************** *** 1772,1776 **** default: { ! wxlState.terror("wxLua: Connect: Incorrect number of parameters."); return 0; } --- 1772,1776 ---- default: { ! wxlState.terror("wxLua: wxEvtHandler Connect: Incorrect number of parameters."); return 0; } *************** *** 1785,1789 **** if (wxlState.IsEnumerationType(evttype_idx)) ! eventType = (int)lua_tonumber(L, evttype_idx); else { --- 1785,1789 ---- if (wxlState.IsEnumerationType(evttype_idx)) ! eventType = (wxEventType)lua_tonumber(L, evttype_idx); else { *************** *** 1810,1816 **** wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! int winId = wxID_ANY; ! int lastId = wxID_ANY; ! int eventType = 0; int nParams = lua_gettop(L); --- 1810,1816 ---- wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! wxWindowID winId = wxID_ANY; ! wxWindowID lastId = wxID_ANY; ! wxEventType eventType = 0; int nParams = lua_gettop(L); *************** *** 1827,1831 **** if (wxlState.IsEnumerationType(3)) ! lastId = (int)lua_tonumber(L, 3); else { --- 1827,1831 ---- if (wxlState.IsEnumerationType(3)) ! lastId = (wxWindowID)lua_tonumber(L, 3); else { *************** *** 1836,1840 **** if (wxlState.IsEnumerationType(2)) ! winId = (int)lua_tonumber(L, 2); else { --- 1836,1840 ---- if (wxlState.IsEnumerationType(2)) ! winId = (wxWindowID)lua_tonumber(L, 2); else { *************** *** 1851,1855 **** if (wxlState.IsEnumerationType(2)) ! winId = (int)lua_tonumber(L, 2); else { --- 1851,1855 ---- if (wxlState.IsEnumerationType(2)) ! winId = (wxWindowID)lua_tonumber(L, 2); else { *************** *** 1875,1879 **** if (wxlState.IsEnumerationType(evttype_idx)) ! eventType = (int)lua_tonumber(L, evttype_idx); else { --- 1875,1879 ---- if (wxlState.IsEnumerationType(evttype_idx)) ! eventType = (wxEventType)lua_tonumber(L, evttype_idx); else { *************** *** 2006,2012 **** returns = self->GetTimes(dtAccess, dtMod, dtCreate); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, dtAccess); ! wxLua_AddToTrackedMemoryList(wxlState, dtMod); ! wxLua_AddToTrackedMemoryList(wxlState, dtCreate); // push the constructed class pointers wxlState.PushUserDataType(s_wxluatag_wxDateTime, dtAccess); --- 2006,2012 ---- returns = self->GetTimes(dtAccess, dtMod, dtCreate); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, dtAccess); ! wxLua_AddTrackedObject(wxlState, dtMod); ! wxLua_AddTrackedObject(wxlState, dtCreate); // push the constructed class pointers wxlState.PushUserDataType(s_wxluatag_wxDateTime, dtAccess); *************** *** 2502,2506 **** returns = new wxBitmap(data, type, width, height, depth); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); --- 2502,2506 ---- returns = new wxBitmap(data, type, width, height, depth); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); *************** *** 2527,2531 **** returns = new wxBitmap(sizeArray); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); --- 2527,2531 ---- returns = new wxBitmap(sizeArray); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); *************** *** 3122,3126 **** returns = new wxImage(width, height, data, static_data); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 3122,3126 ---- returns = new wxImage(width, height, data, static_data); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 3141,3145 **** returns = new wxImage(bitmap->ConvertToImage()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 3141,3145 ---- returns = new wxImage(bitmap->ConvertToImage()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 3689,3693 **** *returns = *self; // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPrintData, returns); --- 3689,3693 ---- *returns = *self; // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPrintData, returns); *************** *** 3707,3711 **** *returns = *self; // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPageSetupDialogData, returns); --- 3707,3711 ---- *returns = *self; // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPageSetupDialogData, returns); *************** *** 3734,3739 **** // we must disconnect them from our tracking list if (printoutForPrinting != NULL) ! wxlState.RemoveTrackedMemory(printoutForPrinting, false); ! wxlState.RemoveTrackedMemory(printout, false); // call constructor --- 3734,3739 ---- // we must disconnect them from our tracking list if (printoutForPrinting != NULL) ! wxlState.RemoveTrackedObject(printoutForPrinting, false); ! wxlState.RemoveTrackedObject(printout, false); // call constructor *************** *** 4404,4408 **** returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); --- 4404,4408 ---- returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); *************** *** 4455,4459 **** returns = new wxLuaPrintout(wxlState, title, pObject); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxLuaPrintout *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaPrintout, returns); --- 4455,4459 ---- returns = new wxLuaPrintout(wxlState, title, pObject); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxLuaPrintout *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaPrintout, returns); *************** *** 4487,4491 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaHtmlWindow, returns); --- 4487,4491 ---- // 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); |