From: John L. <jr...@us...> - 2008-01-24 00:18:47
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/apps/wxluacan/src Modified Files: wxluacan.h wxluacan_bind.cpp Log Message: * The wxLua type numbers are now generated when the first wxLuaState is created rather then when the bindings are registered into Lua. This means that each wxLua type stays the same for the life of the program no matter what bindings are installed or in what order. - The copy of the wxLuaBindingList in the wxLuaState was removed since it is no longer needed. Renamed the functions static wxLuaBinding::GetBindXXX() to FindBindXXX() since they no longer needed the extra wxLuaBindingList parameter and they had the same signature as the existing GetBindXXX() functions. - Added wxLuaState::RegisterBinding(wxLuaBinding*) function to register single bindings at a time. You may also reregister bindings, which means that their metatable functions are simple rewritten. Index: wxluacan_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_bind.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wxluacan_bind.cpp 23 Jan 2008 06:43:34 -0000 1.29 --- wxluacan_bind.cpp 24 Jan 2008 00:18:13 -0000 1.30 *************** *** 167,171 **** m_objectArray = wxLuaGetObjectList_wxluacan(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxluacan(m_functionCount); - InitBinding(); } --- 167,170 ---- *************** *** 179,199 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxluacan_bind(const wxLuaState& wxlState_) - { - wxLuaState wxlState(wxlState_); - wxCHECK_MSG(wxlState.Ok(), false, wxT("Invalid wxLuaState")); - - wxASSERT(!wxlState.GetLuaStateData()->m_bindings_registered); - wxASSERT(!wxlState.GetLuaBinding(wxT("wxluacan"))); - - // ignore binding request when we already have wxluacan registered - if (wxlState.GetLuaBinding(wxT("wxluacan"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxluacan()); - - return true; - } - bool wxLuaBinding_wxluacan_init() { --- 178,181 ---- Index: wxluacan.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wxluacan.h 23 Jan 2008 06:43:34 -0000 1.40 --- wxluacan.h 24 Jan 2008 00:18:13 -0000 1.41 *************** *** 18,24 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 22 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 22 // --------------------------------------------------------------------------- --- 18,24 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 23 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 23 // --------------------------------------------------------------------------- *************** *** 38,43 **** - // bind wxLuaBinding_wxluacan to a single wxLuaState - extern WXLUA_NO_DLLIMPEXP bool wxLuaBinding_wxluacan_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxluacan for all wxLuaStates extern WXLUA_NO_DLLIMPEXP bool wxLuaBinding_wxluacan_init(); --- 38,41 ---- |