From: John L. <jr...@us...> - 2008-01-24 00:18:50
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/modules/wxbind/src Modified Files: wxadv_bind.cpp wxaui_bind.cpp wxbase_bind.cpp wxcore_bind.cpp wxgl_bind.cpp wxhtml_bind.cpp wxmedia_bind.cpp wxnet_bind.cpp wxrichtext_bind.cpp wxstc_bind.cpp wxxml_bind.cpp wxxrc_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: wxbase_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxbase_bind.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wxbase_bind.cpp 23 Jan 2008 06:43:35 -0000 1.11 --- wxbase_bind.cpp 24 Jan 2008 00:18:16 -0000 1.12 *************** *** 2371,2375 **** m_objectArray = wxLuaGetObjectList_wxbase(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxbase(m_functionCount); - InitBinding(); } --- 2371,2374 ---- *************** *** 2394,2414 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxbase_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("wxbase"))); - - // ignore binding request when we already have wxbase registered - if (wxlState.GetLuaBinding(wxT("wxbase"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxbase()); - - return true; - } - bool wxLuaBinding_wxbase_init() { --- 2393,2396 ---- Index: wxnet_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxnet_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxnet_bind.cpp 23 Jan 2008 06:43:38 -0000 1.5 --- wxnet_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 *************** *** 234,238 **** m_objectArray = wxLuaGetObjectList_wxnet(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxnet(m_functionCount); - InitBinding(); } --- 234,237 ---- *************** *** 246,266 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxnet_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("wxnet"))); - - // ignore binding request when we already have wxnet registered - if (wxlState.GetLuaBinding(wxT("wxnet"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxnet()); - - return true; - } - bool wxLuaBinding_wxnet_init() { --- 245,248 ---- Index: wxstc_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxstc_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxstc_bind.cpp 23 Jan 2008 06:43:38 -0000 1.5 --- wxstc_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 *************** *** 1523,1527 **** m_objectArray = wxLuaGetObjectList_wxstc(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxstc(m_functionCount); - InitBinding(); } --- 1523,1526 ---- *************** *** 1535,1555 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxstc_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("wxstc"))); - - // ignore binding request when we already have wxstc registered - if (wxlState.GetLuaBinding(wxT("wxstc"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxstc()); - - return true; - } - bool wxLuaBinding_wxstc_init() { --- 1534,1537 ---- Index: wxgl_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxgl_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxgl_bind.cpp 23 Jan 2008 06:43:38 -0000 1.5 --- wxgl_bind.cpp 24 Jan 2008 00:18:16 -0000 1.6 *************** *** 158,162 **** m_objectArray = wxLuaGetObjectList_wxgl(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxgl(m_functionCount); - InitBinding(); } --- 158,161 ---- *************** *** 170,190 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxgl_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("wxgl"))); - - // ignore binding request when we already have wxgl registered - if (wxlState.GetLuaBinding(wxT("wxgl"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxgl()); - - return true; - } - bool wxLuaBinding_wxgl_init() { --- 169,172 ---- Index: wxxrc_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxrc_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxxrc_bind.cpp 23 Jan 2008 06:43:38 -0000 1.5 --- wxxrc_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 *************** *** 144,148 **** m_objectArray = wxLuaGetObjectList_wxxrc(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxxrc(m_functionCount); - InitBinding(); } --- 144,147 ---- *************** *** 156,176 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxxrc_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("wxxrc"))); - - // ignore binding request when we already have wxxrc registered - if (wxlState.GetLuaBinding(wxT("wxxrc"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxxrc()); - - return true; - } - bool wxLuaBinding_wxxrc_init() { --- 155,158 ---- Index: wxmedia_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxmedia_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxmedia_bind.cpp 23 Jan 2008 06:43:38 -0000 1.5 --- wxmedia_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 *************** *** 188,192 **** m_objectArray = wxLuaGetObjectList_wxmedia(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxmedia(m_functionCount); - InitBinding(); } --- 188,191 ---- *************** *** 200,220 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxmedia_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("wxmedia"))); - - // ignore binding request when we already have wxmedia registered - if (wxlState.GetLuaBinding(wxT("wxmedia"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxmedia()); - - return true; - } - bool wxLuaBinding_wxmedia_init() { --- 199,202 ---- Index: wxcore_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_bind.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wxcore_bind.cpp 23 Jan 2008 06:43:36 -0000 1.13 --- wxcore_bind.cpp 24 Jan 2008 00:18:16 -0000 1.14 *************** *** 5064,5068 **** m_objectArray = wxLuaGetObjectList_wxcore(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxcore(m_functionCount); - InitBinding(); } --- 5064,5067 ---- *************** *** 5131,5151 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxcore_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("wxcore"))); - - // ignore binding request when we already have wxcore registered - if (wxlState.GetLuaBinding(wxT("wxcore"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxcore()); - - return true; - } - bool wxLuaBinding_wxcore_init() { --- 5130,5133 ---- Index: wxadv_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxadv_bind.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxadv_bind.cpp 23 Jan 2008 06:43:35 -0000 1.6 --- wxadv_bind.cpp 24 Jan 2008 00:18:16 -0000 1.7 *************** *** 451,455 **** m_objectArray = wxLuaGetObjectList_wxadv(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxadv(m_functionCount); - InitBinding(); } --- 451,454 ---- *************** *** 463,483 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxadv_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("wxadv"))); - - // ignore binding request when we already have wxadv registered - if (wxlState.GetLuaBinding(wxT("wxadv"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxadv()); - - return true; - } - bool wxLuaBinding_wxadv_init() { --- 462,465 ---- Index: wxrichtext_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxrichtext_bind.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxrichtext_bind.cpp 22 Dec 2007 06:07:14 -0000 1.4 --- wxrichtext_bind.cpp 24 Jan 2008 00:18:17 -0000 1.5 *************** *** 143,147 **** m_objectArray = wxLuaGetObjectList_wxrichtext(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxrichtext(m_functionCount); - InitBinding(); } --- 143,146 ---- *************** *** 155,175 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxrichtext_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("wxrichtext"))); - - // ignore binding request when we already have wxrichtext registered - if (wxlState.GetLuaBinding(wxT("wxrichtext"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxrichtext()); - - return true; - } - bool wxLuaBinding_wxrichtext_init() { --- 154,157 ---- Index: wxhtml_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxhtml_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxhtml_bind.cpp 23 Jan 2008 06:43:38 -0000 1.5 --- wxhtml_bind.cpp 24 Jan 2008 00:18:16 -0000 1.6 *************** *** 229,233 **** m_objectArray = wxLuaGetObjectList_wxhtml(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxhtml(m_functionCount); - InitBinding(); } --- 229,232 ---- *************** *** 241,261 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxhtml_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("wxhtml"))); - - // ignore binding request when we already have wxhtml registered - if (wxlState.GetLuaBinding(wxT("wxhtml"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxhtml()); - - return true; - } - bool wxLuaBinding_wxhtml_init() { --- 240,243 ---- Index: wxaui_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxaui_bind.cpp 23 Jan 2008 06:43:35 -0000 1.7 --- wxaui_bind.cpp 24 Jan 2008 00:18:16 -0000 1.8 *************** *** 285,289 **** m_objectArray = wxLuaGetObjectList_wxaui(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxaui(m_functionCount); - InitBinding(); } --- 285,288 ---- *************** *** 297,317 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxaui_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("wxaui"))); - - // ignore binding request when we already have wxaui registered - if (wxlState.GetLuaBinding(wxT("wxaui"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxaui()); - - return true; - } - bool wxLuaBinding_wxaui_init() { --- 296,299 ---- Index: wxxml_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxml_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxxml_bind.cpp 23 Jan 2008 06:43:38 -0000 1.5 --- wxxml_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 *************** *** 156,160 **** m_objectArray = wxLuaGetObjectList_wxxml(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxxml(m_functionCount); - InitBinding(); } --- 156,159 ---- *************** *** 168,188 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxxml_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("wxxml"))); - - // ignore binding request when we already have wxxml registered - if (wxlState.GetLuaBinding(wxT("wxxml"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxxml()); - - return true; - } - bool wxLuaBinding_wxxml_init() { --- 167,170 ---- |