From: John L. <jr...@us...> - 2008-01-25 23:51:32
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/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: - Removed the wxLuaBinding::PreRegister() and PostRegister() functions and made RegisterBinding() virtual Note: wxLuaBinding::RegisterBinding() now leaves the Lua table that the binding objects were installed into on the stack. You must pop it. * The rules.lua for genwxbind.lua now uses wxLuaBinding_class_declaration and wxLuaBinding_class_implementation to replace wxLuaBinding_preregister and wxLuaBinding_postregister. You may now add whatever you like to the class declaration and implementation source code. Updated to Lua 5.1.3 official Index: wxbase_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxbase_bind.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wxbase_bind.cpp 24 Jan 2008 00:18:16 -0000 1.12 --- wxbase_bind.cpp 25 Jan 2008 23:50:52 -0000 1.13 *************** *** 2373,2387 **** } ! void wxLuaBinding_wxbase::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxbase::PostRegister(const wxLuaState& wxlState, int luaTable) { ! wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); lua_State* L = wxlState.GetLuaState(); lua_pushlstring(L, "NULL", 4); wxluaT_pushuserdatatype(L, NULL, wxluatype_NULL, true, true); ! lua_rawset(L, luaTable); // set t["NULL"] = userdata(NULL) w/ NULL tag p_wxluatype_wxString = &wxluatype_wxString; --- 2373,2386 ---- } ! bool wxLuaBinding_wxbase::RegisterBinding(const wxLuaState& wxlState) { ! bool ret = wxLuaBinding::RegisterBinding(wxlState); ! ! wxCHECK_MSG(wxlState.Ok(), false, wxT("Invalid wxLuaState")); lua_State* L = wxlState.GetLuaState(); lua_pushlstring(L, "NULL", 4); wxluaT_pushuserdatatype(L, NULL, wxluatype_NULL, true, true); ! lua_rawset(L, -3); // set t["NULL"] = userdata(NULL) w/ NULL tag p_wxluatype_wxString = &wxluatype_wxString; *************** *** 2389,2394 **** --- 2388,2396 ---- p_wxluatype_wxSortedArrayString = &wxluatype_wxSortedArrayString; p_wxluatype_wxArrayInt = &wxluatype_wxArrayInt; + + return ret; } + // --------------------------------------------------------------------------- Index: wxnet_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxnet_bind.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxnet_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 --- wxnet_bind.cpp 25 Jan 2008 23:50:52 -0000 1.7 *************** *** 236,245 **** } ! void wxLuaBinding_wxnet::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxnet::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 236,240 ---- } ! // --------------------------------------------------------------------------- Index: wxstc_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxstc_bind.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxstc_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 --- wxstc_bind.cpp 25 Jan 2008 23:50:52 -0000 1.7 *************** *** 1525,1534 **** } ! void wxLuaBinding_wxstc::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxstc::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 1525,1529 ---- } ! // --------------------------------------------------------------------------- Index: wxgl_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxgl_bind.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxgl_bind.cpp 24 Jan 2008 00:18:16 -0000 1.6 --- wxgl_bind.cpp 25 Jan 2008 23:50:52 -0000 1.7 *************** *** 160,169 **** } ! void wxLuaBinding_wxgl::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxgl::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 160,164 ---- } ! // --------------------------------------------------------------------------- Index: wxxrc_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxrc_bind.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxxrc_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 --- wxxrc_bind.cpp 25 Jan 2008 23:50:52 -0000 1.7 *************** *** 146,155 **** } ! void wxLuaBinding_wxxrc::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxxrc::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 146,150 ---- } ! // --------------------------------------------------------------------------- Index: wxmedia_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxmedia_bind.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxmedia_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 --- wxmedia_bind.cpp 25 Jan 2008 23:50:52 -0000 1.7 *************** *** 190,199 **** } ! void wxLuaBinding_wxmedia::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxmedia::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 190,194 ---- } ! // --------------------------------------------------------------------------- Index: wxcore_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_bind.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wxcore_bind.cpp 24 Jan 2008 00:18:16 -0000 1.14 --- wxcore_bind.cpp 25 Jan 2008 23:50:52 -0000 1.15 *************** *** 5066,5070 **** } ! void wxLuaBinding_wxcore::PreRegister(const wxLuaState& wxlState, int luaTable) { #if defined(__MINGW32__) || defined(__GNUWIN32__) --- 5066,5070 ---- } ! bool wxLuaBinding_wxcore::RegisterBinding(const wxLuaState& wxlState) { #if defined(__MINGW32__) || defined(__GNUWIN32__) *************** *** 5121,5131 **** wxLua_wxCROSS_CURSOR = (wxCursor*)wxCROSS_CURSOR; } ! } ! void wxLuaBinding_wxcore::PostRegister(const wxLuaState& wxlState, int luaTable) ! { p_wxluatype_wxEvent = &wxluatype_wxEvent; p_wxluatype_wxWindow = &wxluatype_wxWindow; } // --------------------------------------------------------------------------- --- 5121,5134 ---- wxLua_wxCROSS_CURSOR = (wxCursor*)wxCROSS_CURSOR; } ! ! int ret = wxLuaBinding::RegisterBinding(wxlState); ! p_wxluatype_wxEvent = &wxluatype_wxEvent; p_wxluatype_wxWindow = &wxluatype_wxWindow; + + return ret; } + // --------------------------------------------------------------------------- Index: wxadv_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxadv_bind.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxadv_bind.cpp 24 Jan 2008 00:18:16 -0000 1.7 --- wxadv_bind.cpp 25 Jan 2008 23:50:52 -0000 1.8 *************** *** 453,462 **** } ! void wxLuaBinding_wxadv::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxadv::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 453,457 ---- } ! // --------------------------------------------------------------------------- Index: wxrichtext_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxrichtext_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxrichtext_bind.cpp 24 Jan 2008 00:18:17 -0000 1.5 --- wxrichtext_bind.cpp 25 Jan 2008 23:50:52 -0000 1.6 *************** *** 145,154 **** } ! void wxLuaBinding_wxrichtext::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxrichtext::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 145,149 ---- } ! // --------------------------------------------------------------------------- Index: wxhtml_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxhtml_bind.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxhtml_bind.cpp 24 Jan 2008 00:18:16 -0000 1.6 --- wxhtml_bind.cpp 25 Jan 2008 23:50:52 -0000 1.7 *************** *** 231,240 **** } ! void wxLuaBinding_wxhtml::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxhtml::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 231,235 ---- } ! // --------------------------------------------------------------------------- Index: wxaui_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wxaui_bind.cpp 24 Jan 2008 00:18:16 -0000 1.8 --- wxaui_bind.cpp 25 Jan 2008 23:50:52 -0000 1.9 *************** *** 287,296 **** } ! void wxLuaBinding_wxaui::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxaui::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 287,291 ---- } ! // --------------------------------------------------------------------------- Index: wxxml_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxml_bind.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxxml_bind.cpp 24 Jan 2008 00:18:17 -0000 1.6 --- wxxml_bind.cpp 25 Jan 2008 23:50:52 -0000 1.7 *************** *** 158,167 **** } ! void wxLuaBinding_wxxml::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxxml::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 158,162 ---- } ! // --------------------------------------------------------------------------- |