From: John L. <jr...@us...> - 2009-10-05 02:51:42
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10796/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlcallb.cpp wxlstate.cpp Log Message: Add a few more wxDateTime member functions. Speedup check for wxSpinEvent vs wxScrollEvent in wxLuaEventCallback::OnEvent() Reorder list of lightuserdata keys for LUA_REGISTRYINDEX in wxlstate.h Cleanup in wxLuaStackDialog, remove EnumerateGlobalData() and just treat is as a regular table. Fix ignoring events for controls in controls.wx.lua Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.184 retrieving revision 1.185 diff -C2 -d -r1.184 -r1.185 *** wxlstate.cpp 1 Oct 2009 04:21:02 -0000 1.184 --- wxlstate.cpp 5 Oct 2009 02:51:29 -0000 1.185 *************** *** 26,49 **** //#include "wxluadebug/include/wxldebug.h" // for debugging only ! const char* wxlua_lreg_types_key = "wxLua metatable class types"; ! const char* wxlua_lreg_refs_key = "wxLua Lua object refs"; ! const char* wxlua_lreg_debug_refs_key = "wxLuaDebugData refs"; ! 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"; ! const char* wxlua_lreg_wxluabindings_key = "wxLuaBindings"; const char* wxlua_lreg_weakobjects_key = "wxLua objects pushed"; const char* wxlua_lreg_gcobjects_key = "wxLua gc objects to delete"; const char* wxlua_lreg_evtcallbacks_key = "wxLuaEventCallbacks"; const char* wxlua_lreg_windestroycallbacks_key = "wxLuaWinDestoyCallbacks"; const char* wxlua_lreg_topwindows_key = "wxLua top level wxWindows"; - const char* wxlua_lreg_callbaseclassfunc_key = "wxLua CallBaseClassFunc"; const char* wxlua_lreg_wxeventtype_key = "wxLua wxEventType"; ! const char* wxlua_lreg_wxluastatedata_key = "wxLuaStateData"; ! const char* wxlua_lreg_regtable_key = "wxLua LUA_REGISTRYINDEX tables"; const char* wxlua_metatable_type_key = "wxLua metatable class type"; const char* wxlua_metatable_wxluabindclass_key = "wxLua metatable wxLuaBindClass"; wxLuaState wxNullLuaState(false); --- 26,54 ---- //#include "wxluadebug/include/wxldebug.h" // for debugging only ! const char* wxlua_lreg_regtable_key = "wxLua LUA_REGISTRYINDEX tables"; ! const char* wxlua_lreg_wxluastate_key = "wxLuaState"; ! const char* wxlua_lreg_wxluastatedata_key = "wxLuaStateData"; ! ! const char* wxlua_lreg_wxluabindings_key = "wxLuaBindings installed"; ! const char* wxlua_lreg_classes_key = "wxLuaBindClass structs installed"; ! const char* wxlua_lreg_types_key = "wxLua metatable class types"; ! const char* wxlua_lreg_weakobjects_key = "wxLua objects pushed"; const char* wxlua_lreg_gcobjects_key = "wxLua gc objects to delete"; + const char* wxlua_lreg_derivedmethods_key = "wxLua derived class methods"; const char* wxlua_lreg_evtcallbacks_key = "wxLuaEventCallbacks"; const char* wxlua_lreg_windestroycallbacks_key = "wxLuaWinDestoyCallbacks"; const char* wxlua_lreg_topwindows_key = "wxLua top level wxWindows"; const char* wxlua_lreg_wxeventtype_key = "wxLua wxEventType"; ! const char* wxlua_lreg_callbaseclassfunc_key = "wxLua CallBaseClassFunc"; ! ! const char* wxlua_lreg_refs_key = "wxLua Lua object refs"; ! const char* wxlua_lreg_debug_refs_key = "wxLuaDebugData refs"; const char* wxlua_metatable_type_key = "wxLua metatable class type"; const char* wxlua_metatable_wxluabindclass_key = "wxLua metatable wxLuaBindClass"; + wxLuaState wxNullLuaState(false); Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** wxlbind.cpp 1 Oct 2009 04:21:02 -0000 1.125 --- wxlbind.cpp 5 Oct 2009 02:51:29 -0000 1.126 *************** *** 52,55 **** --- 52,57 ---- int* p_wxluatype_wxEvent = &wxluatype_TUNKNOWN; int* p_wxluatype_wxWindow = &wxluatype_TUNKNOWN; + int* p_wxluatype_wxScrollEvent = &wxluatype_TUNKNOWN; + int* p_wxluatype_wxSpinEvent = &wxluatype_TUNKNOWN; int* p_wxluatype_wxString = &wxluatype_TUNKNOWN; int* p_wxluatype_wxArrayString = &wxluatype_TUNKNOWN; Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** wxlcallb.cpp 25 Sep 2009 18:47:58 -0000 1.60 --- wxlcallb.cpp 5 Oct 2009 02:51:29 -0000 1.61 *************** *** 85,89 **** void wxLuaEventCallback::ClearwxLuaState() { ! m_wxlState.UnRef(); } --- 85,90 ---- void wxLuaEventCallback::ClearwxLuaState() { ! if (m_wxlState.Ok()) ! m_wxlState.UnRef(); } *************** *** 91,98 **** { return wxString::Format(wxT("%s(%d) -> wxLuaEventCallback(%p, ids %d, %d)|wxEvtHandler(%p) -> %s : %s"), ! lua2wx(m_wxlBindEvent ? m_wxlBindEvent->name : "?").c_str(), (int)GetEventType(), this, m_id, m_last_id, ! m_evtHandler, m_evtHandler->GetClassInfo()->GetClassName(), ! m_wxlState.GetwxLuaTypeName(*m_wxlBindEvent->wxluatype).c_str()); } --- 92,101 ---- { return wxString::Format(wxT("%s(%d) -> wxLuaEventCallback(%p, ids %d, %d)|wxEvtHandler(%p) -> %s : %s"), ! lua2wx(m_wxlBindEvent ? m_wxlBindEvent->name : "?NULL?").c_str(), ! (int)GetEventType(), this, m_id, m_last_id, ! m_evtHandler, ! m_evtHandler ? m_evtHandler->GetClassInfo()->GetClassName() : wxT("?NULL?"), ! m_wxlState.GetwxLuaTypeName(m_wxlBindEvent ? *m_wxlBindEvent->wxluatype : WXLUA_TUNKNOWN).c_str()); } *************** *** 106,116 **** wxCHECK_RET(theCallback != NULL, wxT("Invalid wxLuaEventCallback in wxEvent user data")); ! // Not an error if !Ok(), the wxLuaState is cleared during shutdown or after a destroy event. ! wxLuaState wxlState(theCallback->GetwxLuaState()); ! if (wxlState.Ok()) { ! wxlState.SetInEventType(evtType); ! theCallback->OnEvent(&event); ! wxlState.SetInEventType(wxEVT_NULL); } --- 109,122 ---- wxCHECK_RET(theCallback != NULL, wxT("Invalid wxLuaEventCallback in wxEvent user data")); ! if (theCallback != NULL) { ! // Not an error if !Ok(), the wxLuaState is cleared during shutdown or after a destroy event. ! wxLuaState wxlState(theCallback->GetwxLuaState()); ! if (wxlState.Ok()) ! { ! wxlState.SetInEventType(evtType); ! theCallback->OnEvent(&event); ! wxlState.SetInEventType(wxEVT_NULL); ! } } *************** *** 142,151 **** // wxEVT_SCROLL_LINEUP, wxEVT_SCROLL_LINEDOWN, wxEVT_SCROLL_THUMBTRACK ! if ((strcmp(m_wxlBindEvent->name, "wxScrollEvent") == 0) && ! (event->GetClassInfo()->GetClassName() == wxString(wxT("wxSpinEvent")))) { ! const wxLuaBindClass *wxlClass = wxlState.GetBindClass("wxSpinEvent"); ! if (wxlClass != NULL) ! event_wxl_type = *wxlClass->wxluatype; else event_wxl_type = *p_wxluatype_wxEvent; // get the generic wxluatype_wxEvent --- 148,157 ---- // wxEVT_SCROLL_LINEUP, wxEVT_SCROLL_LINEDOWN, wxEVT_SCROLL_THUMBTRACK ! //if ((strcmp(m_wxlBindEvent->name, "wxScrollEvent") == 0) && ! if ((*m_wxlBindEvent->wxluatype == *p_wxluatype_wxScrollEvent) && ! (wxStrcmp(event->GetClassInfo()->GetClassName(), wxT("wxSpinEvent")) == 0)) { ! if (*p_wxluatype_wxEvent != WXLUA_TUNKNOWN) ! event_wxl_type = *p_wxluatype_wxSpinEvent; else event_wxl_type = *p_wxluatype_wxEvent; // get the generic wxluatype_wxEvent |