From: John L. <jr...@us...> - 2008-01-24 00:18:48
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/bindings Modified Files: genwxbind.lua 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: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** genwxbind.lua 23 Jan 2008 06:43:34 -0000 1.160 --- genwxbind.lua 24 Jan 2008 00:18:14 -0000 1.161 *************** *** 18,22 **** -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 22 -- 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 = 23 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. *************** *** 4042,4047 **** table.insert(fileData, "\n\n") - table.insert(fileData, "// bind "..hook_cpp_binding_classname.." to a single wxLuaState\n") - table.insert(fileData, "extern "..output_cpp_impexpsymbol.." bool "..hook_cpp_binding_classname.."_bind(const wxLuaState& wxlState);\n") table.insert(fileData, "// initialize "..hook_cpp_binding_classname.." for all wxLuaStates\n") table.insert(fileData, "extern "..output_cpp_impexpsymbol.." bool "..hook_cpp_binding_classname.."_init();\n\n") --- 4042,4045 ---- *************** *** 4247,4251 **** table.insert(fileData, " m_objectArray = "..hook_cpp_object_funcname.."(m_objectCount);\n") table.insert(fileData, " m_functionArray = "..hook_cpp_function_funcname.."(m_functionCount);\n") - table.insert(fileData, " InitBinding();\n") table.insert(fileData, "}\n\n") --- 4245,4248 ---- *************** *** 4271,4291 **** table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") - table.insert(fileData, "bool "..hook_cpp_binding_classname.."_bind(const wxLuaState& wxlState_)\n") - table.insert(fileData, "{\n") - table.insert(fileData, " wxLuaState wxlState(wxlState_);\n") - table.insert(fileData, " wxCHECK_MSG(wxlState.Ok(), false, wxT(\"Invalid wxLuaState\"));\n") - table.insert(fileData, "\n") - table.insert(fileData, " wxASSERT(!wxlState.GetLuaStateData()->m_bindings_registered);\n") - table.insert(fileData, " wxASSERT(!wxlState.GetLuaBinding(wxT(\""..hook_cpp_namespace.."\")));\n") - table.insert(fileData, "\n") - table.insert(fileData, " // ignore binding request when we already have "..hook_cpp_namespace.." registered\n") - table.insert(fileData, " if (wxlState.GetLuaBinding(wxT(\""..hook_cpp_namespace.."\")))\n") - table.insert(fileData, " return false;\n") - table.insert(fileData, "\n") - table.insert(fileData, " wxlState.GetLuaStateData()->m_bindingList.Append(new "..hook_cpp_binding_classname.."());\n") - table.insert(fileData, "\n") - table.insert(fileData, " return true;\n") - table.insert(fileData, "}\n\n") - table.insert(fileData, "bool "..hook_cpp_binding_classname.."_init()\n") table.insert(fileData, "{\n") --- 4268,4271 ---- |