You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(191) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(238) |
Dec
(68) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(104) |
Feb
(518) |
Mar
(302) |
Apr
(211) |
May
(311) |
Jun
(55) |
Jul
(6) |
Aug
(35) |
Sep
(76) |
Oct
(50) |
Nov
(37) |
Dec
(340) |
2007 |
Jan
(23) |
Feb
(107) |
Mar
(98) |
Apr
(60) |
May
(136) |
Jun
(371) |
Jul
(175) |
Aug
(74) |
Sep
(3) |
Oct
(2) |
Nov
(53) |
Dec
(129) |
2008 |
Jan
(337) |
Feb
(23) |
Mar
(18) |
Apr
(4) |
May
(3) |
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(33) |
Nov
|
Dec
(26) |
2009 |
Jan
(4) |
Feb
(1) |
Mar
(15) |
Apr
|
May
(35) |
Jun
(11) |
Jul
|
Aug
|
Sep
(19) |
Oct
(26) |
Nov
(11) |
Dec
(11) |
2010 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
(8) |
Dec
(7) |
2011 |
Jan
|
Feb
|
Mar
(4) |
Apr
(8) |
May
(5) |
Jun
(8) |
Jul
(1) |
Aug
|
Sep
|
Oct
(5) |
Nov
(13) |
Dec
|
From: John L. <jr...@us...> - 2008-01-25 23:51:27
|
Update of /cvsroot/wxlua/wxLua/modules/lua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/modules/lua/include Modified Files: lauxlib.h 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 |
From: John L. <jr...@us...> - 2008-01-25 23:51:27
|
Update of /cvsroot/wxlua/wxLua/bindings/wxluasocket In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/bindings/wxluasocket Modified Files: wxluasocket_rules.lua 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: wxluasocket_rules.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxluasocket/wxluasocket_rules.lua,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxluasocket_rules.lua 16 Jul 2007 19:34:15 -0000 1.6 --- wxluasocket_rules.lua 25 Jan 2008 23:50:47 -0000 1.7 *************** *** 33,37 **** -- bindings in it. This will be used as #include "hook_cpp_header_filename" in -- the C++ wrapper files, so it must include the proper #include path. ! hook_cpp_header_filename = "wxluasocket/include/wxluasocket_bind.h" ------------------------------------------------------------------------------- --- 33,37 ---- -- bindings in it. This will be used as #include "hook_cpp_header_filename" in -- the C++ wrapper files, so it must include the proper #include path. ! hook_cpp_header_filename = "wxluasocket/include/"..hook_cpp_namespace.."_bind.h" ------------------------------------------------------------------------------- *************** *** 116,129 **** --============================================================================= ! -- virtual void wxLuaBinding::PreRegister function body for the ! -- hook_cpp_binding_classname. You can initialize data here. ! -- Typically this is not necessary and you can rem this out. ! -- wxLuaBinding_PreRegister = nothing to do here ! --============================================================================= ! -- virtual void wxLuaBinding::PostRegister function body for the ! -- hook_cpp_binding_classname. You can load any other custom bindings here. ! -- Typically this is not necessary and you can rem this out. ! -- wxLuaBinding_PostRegister = nothing to do here --============================================================================= --- 116,134 ---- --============================================================================= ! -- Declare functions or member variables for the derived wxLuaBinding class ! -- that will be generated for this binding. The string will be copied verbatim ! -- into the body of the hook_cpp_binding_classname class declaration in the ! -- hook_cpp_header_filename header file. May be remmed out to ignore it. ! -- See usage in the wxWidgets wxbase_rules.lua file. ! --wxLuaBinding_class_declaration = nothing to do here ! ! ------------------------------------------------------------------------------- ! -- Implement the functions or member variables for the derived wxLuaBinding ! -- class that you have declared. The string will be copied into the ! -- hook_cpp_binding_filename source file. May be remmed out to ignore it. ! -- See usage in the wxWidgets wxbase_rules.lua file. ! ! --wxLuaBinding_class_implementation = nothing to do here --============================================================================= |
From: John L. <jr...@us...> - 2008-01-25 23:51:27
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/docs Modified Files: changelog.txt 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: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** changelog.txt 24 Jan 2008 00:19:07 -0000 1.60 --- changelog.txt 25 Jan 2008 23:50:49 -0000 1.61 *************** *** 122,126 **** each wxWidgets library when --enable-wxbind* options are left in "auto" mode ! * Updated Lua to 5.1.3-rc1 - Added static bool wxLuaState::sm_wxAppMainLoop_will_run so that Lua code --- 122,126 ---- each wxWidgets library when --enable-wxbind* options are left in "auto" mode ! * Updated Lua to 5.1.3 - Added static bool wxLuaState::sm_wxAppMainLoop_will_run so that Lua code *************** *** 138,145 **** --- 138,155 ---- to FindBindXXX() since they no longer needed the extra wxLuaBindingList parameter and they had the same signature as the existing GetBindXXX() functions. + Removed the wxLuaBinding::Clone() function as it is no longer used. - 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. + - 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. + version 2.8.4.2 -------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2008-01-25 23:51:27
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/bindings Modified Files: genwxbind.lua 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: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** genwxbind.lua 24 Jan 2008 00:18:14 -0000 1.161 --- genwxbind.lua 25 Jan 2008 23:50:46 -0000 1.162 *************** *** 85,88 **** --- 85,91 ---- assert(type(hook_lua_namespace) == "string", "Rules file ERROR: 'hook_lua_namespace' is not a string") assert(type(hook_cpp_namespace) == "string", "Rules file ERROR: 'hook_cpp_namespace' is not a string") + + assert(wxLuaBinding_PreRegister == nil, "Rules file ERROR: 'wxLuaBinding_PreRegister' is deprecated") + assert(wxLuaBinding_PostRegister == nil, "Rules file ERROR: 'wxLuaBinding_PreRegister' is deprecated") end *************** *** 1457,1460 **** --- 1460,1465 ---- local time1 = os.time() + local updated_files = 0 + -- generatelanguage binding, binding is stored in objectList for i = 1, #interfaceList do *************** *** 1467,1475 **** -- create c/c++ file local fileData = GenerateBindingFileTable(interface) ! WriteTableToFile(interface.CPPFileName, fileData, false) end local fileData = GenerateHookHeaderFileTable() ! WriteTableToFile(GetCPPHeaderFileName(hook_cpp_header_filename), fileData, false) local fileData = {} -- reset to empty table --- 1472,1486 ---- -- create c/c++ file local fileData = GenerateBindingFileTable(interface) ! local written = WriteTableToFile(interface.CPPFileName, fileData, false) ! if written then ! updated_files = updated_files + 1 ! end end local fileData = GenerateHookHeaderFileTable() ! local written = WriteTableToFile(GetCPPHeaderFileName(hook_cpp_header_filename), fileData, false) ! if written then ! updated_files = updated_files + 1 ! end local fileData = {} -- reset to empty table *************** *** 1481,1488 **** fileData = GenerateHookCFunctionFileTable(fileData) fileData = GenerateHookClassFileTable(fileData) ! WriteTableToFile(GetCPPFileName(hook_cpp_binding_filename), fileData, false) local time2 = os.time() --print("Timing: GenerateLuaLanguageBinding and write files "..os.difftime(time2, time1).." seconds.") end --- 1492,1503 ---- fileData = GenerateHookCFunctionFileTable(fileData) fileData = GenerateHookClassFileTable(fileData) ! written = WriteTableToFile(GetCPPFileName(hook_cpp_binding_filename), fileData, false) ! if written then ! updated_files = updated_files + 1 ! end local time2 = os.time() --print("Timing: GenerateLuaLanguageBinding and write files "..os.difftime(time2, time1).." seconds.") + return updated_files end *************** *** 4032,4041 **** table.insert(fileData, "public:\n") table.insert(fileData, " "..hook_cpp_binding_classname.."();\n") - table.insert(fileData, " virtual wxLuaBinding* Clone() const { return new "..hook_cpp_binding_classname.."; }\n") - table.insert(fileData, "\n") - table.insert(fileData, "protected:\n") - table.insert(fileData, " virtual void PreRegister(const wxLuaState& wxlState, int luaTable);\n") - table.insert(fileData, " virtual void PostRegister(const wxLuaState& wxlState, int luaTable);\n") table.insert(fileData, "\n") table.insert(fileData, " DECLARE_DYNAMIC_CLASS("..hook_cpp_binding_classname..")\n") table.insert(fileData, "};\n") --- 4047,4053 ---- table.insert(fileData, "public:\n") table.insert(fileData, " "..hook_cpp_binding_classname.."();\n") table.insert(fileData, "\n") + table.insert(fileData, wxLuaBinding_class_declaration or "") + table.insert(fileData, "\nprivate:\n") table.insert(fileData, " DECLARE_DYNAMIC_CLASS("..hook_cpp_binding_classname..")\n") table.insert(fileData, "};\n") *************** *** 4247,4268 **** table.insert(fileData, "}\n\n") ! -- load preregister fn from rules file ! if wxLuaBinding_PreRegister and string.len(wxLuaBinding_PreRegister) then ! table.insert(fileData, "void "..hook_cpp_binding_classname.."::PreRegister(const wxLuaState& wxlState, int luaTable)\n") ! else ! table.insert(fileData, "void "..hook_cpp_binding_classname.."::PreRegister(const wxLuaState& , int )\n") ! end ! table.insert(fileData, "{\n") ! table.insert(fileData, wxLuaBinding_PreRegister or "") ! table.insert(fileData, "}\n") ! -- load postregister fn from rules file ! if wxLuaBinding_PostRegister and string.len(wxLuaBinding_PostRegister) then ! table.insert(fileData, "void "..hook_cpp_binding_classname.."::PostRegister(const wxLuaState& wxlState, int luaTable)\n") ! else ! table.insert(fileData, "void "..hook_cpp_binding_classname.."::PostRegister(const wxLuaState&, int )\n") ! end ! table.insert(fileData, "{\n") ! table.insert(fileData, wxLuaBinding_PostRegister or "") ! table.insert(fileData, "}\n\n") table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") --- 4259,4263 ---- table.insert(fileData, "}\n\n") ! table.insert(fileData, (wxLuaBinding_class_implementation or "").."\n\n") table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") *************** *** 4890,4896 **** end if #interface_fileTable > 0 then local interfaceList = GenerateInterfaceData() ! WriteWrapperFiles(interfaceList) end --- 4885,4893 ---- end + local updated_files = 0 + if #interface_fileTable > 0 then local interfaceList = GenerateInterfaceData() ! updated_files = WriteWrapperFiles(interfaceList) end *************** *** 4907,4912 **** end ! print("Timing: "..os.difftime(os.time(), time1).." seconds.") ! print("Done\n") end --- 4904,4908 ---- end ! print("Done. "..updated_files.." Files were updated in "..os.difftime(os.time(), time1).." seconds.\n") end |
From: John L. <jr...@us...> - 2008-01-25 23:51:27
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/apps/wxluacan/src Modified Files: wxluacan.cpp wxluacan_bind.cpp wxluacan_rules.lua Added Files: wxluacan_bind.h Removed Files: wxluacan.h 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 --- NEW FILE: wxluacan_bind.h --- // --------------------------------------------------------------------------- // wxluacan.h - headers and tags for wxLua binding // // This file was generated by genwxbind.lua // Any changes made to this file may be lost when file is regenerated // --------------------------------------------------------------------------- #ifndef __HOOK_WXLUA_wxluacan_H__ #define __HOOK_WXLUA_wxluacan_H__ #include "wxbind/include/wxcore_bind.h" #include "wxlua/include/wxlstate.h" #include "wxlua/include/wxlbind.h" // --------------------------------------------------------------------------- // Check if the version of binding generator used to create this is older than // 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 // --------------------------------------------------------------------------- // binding class class WXLUA_NO_DLLIMPEXP wxLuaBinding_wxluacan : public wxLuaBinding { public: wxLuaBinding_wxluacan(); private: DECLARE_DYNAMIC_CLASS(wxLuaBinding_wxluacan) }; // initialize wxLuaBinding_wxluacan for all wxLuaStates extern WXLUA_NO_DLLIMPEXP bool wxLuaBinding_wxluacan_init(); // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include "cancom.h" #include "canlua.h" #include "cansim.h" #include "wx/gdicmn.h" // --------------------------------------------------------------------------- // Lua Tag Method Values and Tables for each Class // --------------------------------------------------------------------------- extern WXLUA_NO_DLLIMPEXP_DATA(int) wxluatype_wxlCan; extern WXLUA_NO_DLLIMPEXP wxLuaBindMethod wxlCan_methods[]; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlCan_methodCount; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxluatype_wxlCanObj; extern WXLUA_NO_DLLIMPEXP wxLuaBindMethod wxlCanObj_methods[]; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlCanObj_methodCount; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxluatype_wxlCanObjAddScript; extern WXLUA_NO_DLLIMPEXP wxLuaBindMethod wxlCanObjAddScript_methods[]; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlCanObjAddScript_methodCount; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxluatype_wxlCanObjCircle; extern WXLUA_NO_DLLIMPEXP wxLuaBindMethod wxlCanObjCircle_methods[]; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlCanObjCircle_methodCount; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxluatype_wxlCanObjRect; extern WXLUA_NO_DLLIMPEXP wxLuaBindMethod wxlCanObjRect_methods[]; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlCanObjRect_methodCount; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxluatype_wxlCanObjScript; extern WXLUA_NO_DLLIMPEXP wxLuaBindMethod wxlCanObjScript_methods[]; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlCanObjScript_methodCount; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxluatype_wxlLuaCanCmd; extern WXLUA_NO_DLLIMPEXP wxLuaBindMethod wxlLuaCanCmd_methods[]; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlLuaCanCmd_methodCount; // --------------------------------------------------------------------------- // Encapsulation Declarations - need to be public for other bindings. // --------------------------------------------------------------------------- #endif // __HOOK_WXLUA_wxluacan_H__ --- wxluacan.h DELETED --- Index: wxluacan.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wxluacan.cpp 23 Jan 2008 06:43:34 -0000 1.39 --- wxluacan.cpp 25 Jan 2008 23:50:45 -0000 1.40 *************** *** 17,21 **** #include "wxlua/include/wxlstate.h" ! #include "wxluacan.h" --- 17,21 ---- #include "wxlua/include/wxlstate.h" ! #include "wxluacan_bind.h" Index: wxluacan_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_bind.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** wxluacan_bind.cpp 24 Jan 2008 00:18:13 -0000 1.30 --- wxluacan_bind.cpp 25 Jan 2008 23:50:46 -0000 1.31 *************** *** 17,21 **** #include "wxlua/include/wxlstate.h" ! #include "wxluacan.h" --- 17,21 ---- #include "wxlua/include/wxlstate.h" ! #include "wxluacan_bind.h" *************** *** 169,178 **** } ! void wxLuaBinding_wxluacan::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxluacan::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 169,173 ---- } ! // --------------------------------------------------------------------------- Index: wxluacan_rules.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_rules.lua,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxluacan_rules.lua 6 Aug 2007 01:46:32 -0000 1.15 --- wxluacan_rules.lua 25 Jan 2008 23:50:46 -0000 1.16 *************** *** 29,33 **** -- bindings in it. This will be used as #include "hook_cpp_header_filename" in -- the C++ wrapper files, so it must include the proper #include path. ! hook_cpp_header_filename = "wxluacan.h" ------------------------------------------------------------------------------- --- 29,33 ---- -- bindings in it. This will be used as #include "hook_cpp_header_filename" in -- the C++ wrapper files, so it must include the proper #include path. ! hook_cpp_header_filename = hook_cpp_namespace.."_bind.h" ------------------------------------------------------------------------------- *************** *** 108,121 **** --============================================================================= ! -- virtual void wxLuaBinding::PreRegister function body for the ! -- hook_cpp_binding_classname. You can initialize data here. ! -- Typically this is not necessary and you can rem this out. ! -- wxLuaBinding_PreRegister = nothing to do here ! --============================================================================= ! -- virtual void wxLuaBinding::PostRegister function body for the ! -- hook_cpp_binding_classname. You can load any other custom bindings here. ! -- Typically this is not necessary and you can rem this out. ! -- wxLuaBinding_PostRegister = nothing to do here --============================================================================= --- 108,126 ---- --============================================================================= ! -- Declare functions or member variables for the derived wxLuaBinding class ! -- that will be generated for this binding. The string will be copied verbatim ! -- into the body of the hook_cpp_binding_classname class declaration in the ! -- hook_cpp_header_filename header file. May be remmed out to ignore it. ! -- See usage in the wxWidgets wxbase_rules.lua file. ! --wxLuaBinding_class_declaration = nothing to do here ! ! ------------------------------------------------------------------------------- ! -- Implement the functions or member variables for the derived wxLuaBinding ! -- class that you have declared. The string will be copied into the ! -- hook_cpp_binding_filename source file. May be remmed out to ignore it. ! -- See usage in the wxWidgets wxbase_rules.lua file. ! ! --wxLuaBinding_class_implementation = nothing to do here --============================================================================= |
From: John L. <jr...@us...> - 2008-01-25 23:51:27
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/bindings/wxlua Modified Files: wxlua_rules.lua 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: wxlua_rules.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua_rules.lua,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxlua_rules.lua 23 Jan 2008 06:43:34 -0000 1.3 --- wxlua_rules.lua 25 Jan 2008 23:50:47 -0000 1.4 *************** *** 33,37 **** -- bindings in it. This will be used as #include "hook_cpp_header_filename" in -- the C++ wrapper files, so it must include the proper #include path. ! hook_cpp_header_filename = "wxlua/include/wxlua_bind.h" ------------------------------------------------------------------------------- --- 33,37 ---- -- bindings in it. This will be used as #include "hook_cpp_header_filename" in -- the C++ wrapper files, so it must include the proper #include path. ! hook_cpp_header_filename = "wxlua/include/"..hook_cpp_namespace.."_bind.h" ------------------------------------------------------------------------------- *************** *** 116,136 **** --============================================================================= ! -- virtual void wxLuaBinding::PreRegister function body for the ! -- hook_cpp_binding_classname. You can initialize data here. ! -- Typically this is not necessary and you can rem this out. ! --wxLuaBinding_PreRegister = ! --============================================================================= ! -- virtual void wxLuaBinding::PostRegister function body for the ! -- hook_cpp_binding_classname. You can load any other custom bindings here. ! -- Typically this is not necessary and you can rem this out. ! wxLuaBinding_PostRegister = [[ ! 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 ]] --- 116,150 ---- --============================================================================= ! -- Declare functions or member variables for the derived wxLuaBinding class ! -- that will be generated for this binding. The string will be copied verbatim ! -- into the body of the hook_cpp_binding_classname class declaration in the ! -- hook_cpp_header_filename header file. May be remmed out to ignore it. ! -- See usage in the wxWidgets wxbase_rules.lua file. ! wxLuaBinding_class_declaration = [[ ! virtual bool RegisterBinding(const wxLuaState& wxlState); ! ]] ! ! ------------------------------------------------------------------------------- ! -- Implement the functions or member variables for the derived wxLuaBinding ! -- class that you have declared. The string will be copied into the ! -- hook_cpp_binding_filename source file. May be remmed out to ignore it. ! -- See usage in the wxWidgets wxbase_rules.lua file. ! ! wxLuaBinding_class_implementation = ! "bool "..hook_cpp_binding_classname.."::RegisterBinding(const wxLuaState& wxlState)\n".. ! [[ ! { ! bool ret = wxLuaBinding::RegisterBinding(wxlState); ! 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 ! ! return ret; ! } ]] |
From: John L. <jr...@us...> - 2008-01-25 23:51:27
|
Update of /cvsroot/wxlua/wxLua/apps/build/msvc8 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/apps/build/msvc8 Modified Files: apps_app_wxluacan.vcproj 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: apps_app_wxluacan.vcproj =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/build/msvc8/apps_app_wxluacan.vcproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** apps_app_wxluacan.vcproj 20 Jan 2008 22:40:05 -0000 1.13 --- apps_app_wxluacan.vcproj 25 Jan 2008 23:50:44 -0000 1.14 *************** *** 1551,1555 **** /> <File ! RelativePath="..\..\wxluacan\src\wxluacan.h" /> </Filter> --- 1551,1555 ---- /> <File ! RelativePath="..\..\wxluacan\src\wxluacan_bind.h" /> </Filter> |
From: John L. <jr...@us...> - 2008-01-25 23:51:01
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/modules/wxluasocket/src Modified Files: wxluasocket_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: wxluasocket_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket_bind.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** wxluasocket_bind.cpp 24 Jan 2008 00:18:19 -0000 1.27 --- wxluasocket_bind.cpp 25 Jan 2008 23:50:54 -0000 1.28 *************** *** 163,172 **** } ! void wxLuaBinding_wxluasocket::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxluasocket::PostRegister(const wxLuaState&, int ) ! { ! } // --------------------------------------------------------------------------- --- 163,167 ---- } ! // --------------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2008-01-25 23:51:00
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlstate.cpp wxlua_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: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.166 retrieving revision 1.167 diff -C2 -d -r1.166 -r1.167 *** wxlstate.cpp 24 Jan 2008 00:18:18 -0000 1.166 --- wxlstate.cpp 25 Jan 2008 23:50:53 -0000 1.167 *************** *** 2377,2381 **** // register our NULL type ! wxluatype_NULL = wxluaT_newmetatable(L, wxluatype_NULL); // now register bindings --- 2377,2382 ---- // register our NULL type ! //wxluatype_NULL = wxluaT_newmetatable(L, wxluatype_NULL); ! wxLuaBinding::InstallClassMetatable(L, &wxLuaBindClass_NULL); // now register bindings *************** *** 2770,2776 **** wxLuaBinding::InitAllBindings(); // only runs the first time through ! binding->RegisterBinding(*this); ! return true; } --- 2771,2778 ---- wxLuaBinding::InitAllBindings(); // only runs the first time through ! bool ret = binding->RegisterBinding(*this); ! if (ret) lua_Pop(1); ! return ret; } *************** *** 2786,2789 **** --- 2788,2793 ---- wxLuaBinding* binding = node->GetData(); binding->RegisterBinding(*this); + lua_Pop(1); // pop the Lua table the binding was installed into + node = node->GetNext(); } Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** wxlbind.cpp 24 Jan 2008 00:18:17 -0000 1.118 --- wxlbind.cpp 25 Jan 2008 23:50:53 -0000 1.119 *************** *** 47,50 **** --- 47,53 ---- int wxluatype_NULL = WXLUA_TNULL; + wxLuaBindClass wxLuaBindClass_NULL = + { "NULL", NULL, 0, NULL, &wxluatype_NULL, NULL, NULL, g_wxluanumberArray_None, 0, }; + static int wxluatype_dummy = WXLUA_TUNKNOWN; int* p_wxluatype_wxEvent = &wxluatype_dummy; *************** *** 542,546 **** wxString name = wxluaT_typename(L, wxl_type); if (!name.IsEmpty()) ! str += wxString::Format(wxT(" [%s(%p, %d)]"), name.c_str(), wxlua_touserdata(L, 1, false), wxl_type); } else --- 545,556 ---- wxString name = wxluaT_typename(L, wxl_type); if (!name.IsEmpty()) ! { ! // GCC prints '(' for NULL %p for some reason. ! void* p = wxlua_touserdata(L, 1, false); ! if (p) ! str += wxString::Format(wxT(" [%s(%p, %d)]"), name.c_str(), p, wxl_type); ! else ! str += wxString::Format(wxT(" [%s(0x0, %d)]"), name.c_str(), wxl_type); ! } } else *************** *** 942,946 **** wxLuaBindingList wxLuaBinding::sm_bindingList; bool wxLuaBinding::sm_bindingList_initialized = false; ! int wxLuaBinding::sm_wxluatype_max = WXLUA_T_MAX; wxLuaBinding::wxLuaBinding() --- 952,956 ---- wxLuaBindingList wxLuaBinding::sm_bindingList; bool wxLuaBinding::sm_bindingList_initialized = false; ! int wxLuaBinding::sm_wxluatype_max = WXLUA_TNULL; // highest wxLua type initially wxLuaBinding::wxLuaBinding() *************** *** 1024,1030 **** } - // leave the table on the stack, it's the one we'll populate - int bind_table_idx = lua_gettop(L); - // Find a registered binding with the same namespace, if any, // and share the table with that of the previously loaded binding --- 1034,1037 ---- *************** *** 1069,1100 **** lua_pop(L, 1); // pop table - // Call the binding functions - PreRegister(wxlState, bind_table_idx); // register all our classes etc. in the wxLua table ! DoRegisterBinding(wxlState, bind_table_idx); ! PostRegister(wxlState, bind_table_idx); ! ! lua_pop(L, 1); // pop the table created above return true; } ! void wxLuaBinding::DoRegisterBinding(const wxLuaState& wxlState, int bind_table_idx) { - // Replace the metatable functions for the classes we push into Lua - static const luaL_reg s_funcTable[] = - { - {"__gc", wxlua_wxLuaBindClass__gc }, - {"__index", wxlua_wxLuaBindClass__index }, - {"__newindex", wxlua_wxLuaBindClass__newindex }, - {"__tostring", wxlua_wxLuaBindClass__tostring } - }; - static const size_t s_funcCount = sizeof(s_funcTable)/sizeof(s_funcTable[0]); - wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); lua_State *L = wxlState.GetLuaState(); size_t n; - int wxl_type = WXLUA_TUNKNOWN; // install the classes, functions and methods, creating new wxLua types --- 1076,1091 ---- lua_pop(L, 1); // pop table // register all our classes etc. in the wxLua table ! DoRegisterBinding(wxlState); return true; } ! void wxLuaBinding::DoRegisterBinding(const wxLuaState& wxlState) const { wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); lua_State *L = wxlState.GetLuaState(); size_t n; // install the classes, functions and methods, creating new wxLua types *************** *** 1103,1265 **** for (n = 0; n < m_classCount; ++n, ++wxlClass) { ! // ------------------------------------------------------------------ ! // Add to the lookup table for "class name" to wxLuaBindClass struct ! lua_pushlightuserdata(L, &wxlua_lreg_classes_key); ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the classes table) ! lua_pushstring(L, wxlClass->name); // push key ! lua_pushlightuserdata(L, (void *)wxlClass); // push value ! lua_rawset(L, -3); // set t[key] = value, pops key and value ! lua_pop(L, 1); // pop wxlua_lreg_classes_key table ! ! // ------------------------------------------------------------------ ! // Create a new metatable for this class with a numerical wxLua type index ! ! wxl_type = *wxlClass->wxluatype; ! ! // we may be reregistering this binding, get the old metatable, we'll rewrite it ! if (!wxluaT_getmetatable(L, wxl_type)) ! wxluaT_newmetatable(L, wxl_type); // create metatable, is on top of stack ! ! // store a lookup in the class metatable to the wxLuaBindClass struct ! lua_pushlightuserdata(L, &wxlua_metatable_wxluabindclass_key); // push key ! lua_pushlightuserdata(L, (void *)wxlClass); // push value ! lua_rawset(L, -3); // set t[key] = value, pops key and value ! ! // set the functions for the class in the metatable ! for (size_t i_func = 0; i_func < s_funcCount; ++i_func) ! { ! lua_pushstring(L, s_funcTable[i_func].name); // push method name ! lua_pushlightuserdata(L, (void *)wxlClass); // push the userdata ! lua_pushcclosure(L, s_funcTable[i_func].func, 1); // push func with wxlClass as upvalue ! lua_rawset(L, -3); // t["method_name"] = closure of func and upvalues ! } ! ! lua_pop(L, 1); // pop metatable from wxluaT_newmetatable() ! ! // ------------------------------------------------------------------ ! // Create and install the table for the class ! ! lua_pushstring(L, wxlClass->name); // push key ! lua_newtable(L); // push value, the table we use as the class ! ! // Install the member enums for the classname table ! for (int i_enum = 0; i_enum < wxlClass->enums_n; ++i_enum) ! { ! lua_pushstring(L, wxlClass->enums[i_enum].name); ! lua_pushnumber(L, wxlClass->enums[i_enum].value); ! lua_rawset(L, -3); ! } ! ! int method_count = wxlClass->wxluamethods_n; ! ! // Install the static functions for the classname table ! wxLuaBindMethod *wxlMethod = wxlClass->wxluamethods; ! for (int i_static_method = 0; i_static_method < method_count; ++i_static_method, ++wxlMethod) ! { ! // we will handle the WXLUAMETHOD_GET/SETPROP|WXLUAMETHOD_STATIC using __index and __newindex ! if (((wxlMethod->method_type & (WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC)) == (WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC)) && ! (wxlMethod->wxluacfuncs_n > 0)) ! { ! lua_pushstring(L, wxlMethod->name); ! lua_pushlightuserdata(L, wxlMethod); ! if (wxlMethod->wxluacfuncs_n > 1) ! lua_pushcclosure(L, wxlua_callOverloadedFunction, 1); ! else ! lua_pushcclosure(L, wxlMethod->wxluacfuncs[0].lua_cfunc, 1); ! ! lua_rawset(L, -3); ! } ! } ! ! // Create a metatable for the "class" table ! lua_newtable(L); ! lua_pushlstring(L, "__index", 7); ! lua_pushlightuserdata(L, wxlClass); ! lua_pushcclosure(L, wxlua_wxLuaBindMethod_table__index, 1); ! lua_rawset(L, -3); ! ! lua_pushlstring(L, "__newindex", 10); ! lua_pushlightuserdata(L, wxlClass); ! lua_pushcclosure(L, wxlua_wxLuaBindMethod_table__newindex, 1); ! lua_rawset(L, -3); ! ! //lua_pushstring(L, "__metatable"); ! //lua_pushstring(L, "Metatable is not accessible"); ! //lua_rawset(L, -3); ! lua_setmetatable(L, -2); // pops the metatable ! ! // Finalize the class table since we may not have a constructor ! // or have multiple constructors. ! lua_rawset(L, -3); // set t[key] = value, pops key and value ! ! // ------------------------------------------------------------------ ! // Install public functions like constructors or global functions ! wxlMethod = wxlClass->wxluamethods; ! for (int i_method = 0; i_method < method_count; ++i_method, ++wxlMethod) ! { ! if (WXLUA_HASBIT(wxlMethod->method_type, WXLUAMETHOD_CONSTRUCTOR | WXLUAMETHOD_CFUNCTION) && wxlMethod->wxluacfuncs_n) ! { ! #if 1 // C++ class constructors are tables and use the __call metatable to make them "functions" ! ! // push name of nested table and create the table or use existing ! // we do it this way since we can have multiple constructors (renamed) ! // that are of the same class and so they share the same wxLua type. ! lua_pushstring(L, wxlMethod->name); ! ! if (strcmp(wxlMethod->name, wxlClass->name) != 0) ! lua_newtable(L); ! else ! lua_getfield(L, bind_table_idx, wxlMethod->name); ! ! // add the items to the table as t[first pushed] = second pushed ! lua_pushlstring(L, "new", 3); ! lua_pushlightuserdata(L, wxlMethod); ! lua_pushcclosure(L, wxlua_callOverloadedFunction, 1); ! lua_rawset(L, -3); ! ! // Add __call to the metatable for this table ! bool has_meta = (lua_getmetatable(L, -1) != 0); ! if (!has_meta) lua_newtable(L); ! ! lua_pushlstring(L, "__call", 6); ! lua_pushlightuserdata(L, wxlMethod); ! lua_pushcclosure(L, wxlua_wxLuaBindMethod_table__call, 1); ! lua_rawset(L, -3); ! ! //lua_pushstring(L, "__metatable"); ! //lua_pushstring(L, "Metatable is not accessible"); ! //lua_rawset(L, -3); ! ! if (!has_meta) ! lua_setmetatable(L, -2); ! else ! lua_pop(L, 1); ! ! // add table to the binding table t[wxlMethod->name] = { this table } ! lua_rawset(L, -3); // set t[key] = value, pops key and value ! ! #elif 0 // C++ constructors are userdata, use metatable for access to items. ! ! // This almost works, but we need to add __call to the metatable which means ! // that if you append () to any instance of this class you call the constructor. ! ! lua_pushstring(L, wxlMethod->name); ! ! const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); ! *ptr = wxlClass; ! ! wxluaR_getref(L, iTag); ! lua_setmetatable(L, -2); ! ! lua_rawset(L, -3); ! ! #else // C++ class constructors are cfunctions only ! ! lua_pushstring(L, wxlMethod->name); ! lua_pushcfunction(L, wxlMethod->wxluacfuncs); ! lua_rawset(L, -3); ! #endif ! } ! } } --- 1094,1099 ---- for (n = 0; n < m_classCount; ++n, ++wxlClass) { ! InstallClassMetatable(L, wxlClass); ! InstallClass(L, wxlClass); } *************** *** 1316,1319 **** --- 1150,1313 ---- } + /* static */ + bool wxLuaBinding::InstallClassMetatable(lua_State* L, const wxLuaBindClass* wxlClass) + { + // Replace the metatable functions for the classes we push into Lua + static const luaL_reg s_funcTable[] = + { + {"__gc", wxlua_wxLuaBindClass__gc }, + {"__index", wxlua_wxLuaBindClass__index }, + {"__newindex", wxlua_wxLuaBindClass__newindex }, + {"__tostring", wxlua_wxLuaBindClass__tostring } + }; + static const size_t s_funcCount = sizeof(s_funcTable)/sizeof(s_funcTable[0]); + + // ------------------------------------------------------------------ + // Add to the lookup table for "class name" to wxLuaBindClass struct + lua_pushlightuserdata(L, &wxlua_lreg_classes_key); + lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the classes table) + lua_pushstring(L, wxlClass->name); // push key + lua_pushlightuserdata(L, (void *)wxlClass); // push value + lua_rawset(L, -3); // set t[key] = value, pops key and value + lua_pop(L, 1); // pop wxlua_lreg_classes_key table + + // ------------------------------------------------------------------ + // Create a new metatable for this class with a numerical wxLua type index + + int wxl_type = *wxlClass->wxluatype; + + // we may be reregistering this binding, get the old metatable, we'll rewrite it + if (!wxluaT_getmetatable(L, wxl_type)) + wxluaT_newmetatable(L, wxl_type); // create metatable, is on top of stack + + // store a lookup in the class metatable to the wxLuaBindClass struct + lua_pushlightuserdata(L, &wxlua_metatable_wxluabindclass_key); // push key + lua_pushlightuserdata(L, (void *)wxlClass); // push value + lua_rawset(L, -3); // set t[key] = value, pops key and value + + // set the functions for the class in the metatable + for (size_t i_func = 0; i_func < s_funcCount; ++i_func) + { + lua_pushstring(L, s_funcTable[i_func].name); // push method name + lua_pushlightuserdata(L, (void *)wxlClass); // push the userdata + lua_pushcclosure(L, s_funcTable[i_func].func, 1); // push func with wxlClass as upvalue + lua_rawset(L, -3); // t["method_name"] = closure of func and upvalues + } + + lua_pop(L, 1); // pop metatable from wxluaT_newmetatable() + + return true; + } + + /* static */ + bool wxLuaBinding::InstallClass(lua_State* L, const wxLuaBindClass* wxlClass) + { + // ------------------------------------------------------------------ + // Create and install the table for the class + + lua_pushstring(L, wxlClass->name); // push key + lua_newtable(L); // push value, the table we use as the class + + // Install the member enums for the classname table + for (int i_enum = 0; i_enum < wxlClass->enums_n; ++i_enum) + { + lua_pushstring(L, wxlClass->enums[i_enum].name); + lua_pushnumber(L, wxlClass->enums[i_enum].value); + lua_rawset(L, -3); + } + + int method_count = wxlClass->wxluamethods_n; + + // Install the static functions for the classname table + wxLuaBindMethod *wxlMethod = wxlClass->wxluamethods; + for (int i_static_method = 0; i_static_method < method_count; ++i_static_method, ++wxlMethod) + { + // we will handle the WXLUAMETHOD_GET/SETPROP|WXLUAMETHOD_STATIC using __index and __newindex + if (((wxlMethod->method_type & (WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC)) == (WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC)) && + (wxlMethod->wxluacfuncs_n > 0)) + { + lua_pushstring(L, wxlMethod->name); + lua_pushlightuserdata(L, wxlMethod); + if (wxlMethod->wxluacfuncs_n > 1) + lua_pushcclosure(L, wxlua_callOverloadedFunction, 1); + else + lua_pushcclosure(L, wxlMethod->wxluacfuncs[0].lua_cfunc, 1); + + lua_rawset(L, -3); + } + } + + // Create a metatable for the "class" table + lua_newtable(L); + lua_pushlstring(L, "__index", 7); + lua_pushlightuserdata(L, (void*)wxlClass); + lua_pushcclosure(L, wxlua_wxLuaBindMethod_table__index, 1); + lua_rawset(L, -3); + + lua_pushlstring(L, "__newindex", 10); + lua_pushlightuserdata(L, (void*)wxlClass); + lua_pushcclosure(L, wxlua_wxLuaBindMethod_table__newindex, 1); + lua_rawset(L, -3); + + //lua_pushstring(L, "__metatable"); + //lua_pushstring(L, "Metatable is not accessible"); + //lua_rawset(L, -3); + lua_setmetatable(L, -2); // pops the metatable + + // Finalize the class table since we may not have a constructor + // or have multiple constructors. + lua_rawset(L, -3); // set t[key] = value, pops key and value + + // ------------------------------------------------------------------ + // Install public functions like constructors or global functions + wxlMethod = wxlClass->wxluamethods; + for (int i_method = 0; i_method < method_count; ++i_method, ++wxlMethod) + { + if (WXLUA_HASBIT(wxlMethod->method_type, WXLUAMETHOD_CONSTRUCTOR | WXLUAMETHOD_CFUNCTION) && wxlMethod->wxluacfuncs_n) + { + // push name of nested table and create the table or use existing + // we do it this way since we can have multiple constructors (renamed) + // that are of the same class and so they share the same wxLua type. + lua_pushstring(L, wxlMethod->name); + + if (strcmp(wxlMethod->name, wxlClass->name) != 0) + lua_newtable(L); + else + lua_getfield(L, -2, wxlMethod->name); + + // add the items to the table as t[first pushed] = second pushed + lua_pushlstring(L, "new", 3); + lua_pushlightuserdata(L, wxlMethod); + lua_pushcclosure(L, wxlua_callOverloadedFunction, 1); + lua_rawset(L, -3); + + // Add __call to the metatable for this table + bool has_meta = (lua_getmetatable(L, -1) != 0); + if (!has_meta) lua_newtable(L); + + lua_pushlstring(L, "__call", 6); + lua_pushlightuserdata(L, wxlMethod); + lua_pushcclosure(L, wxlua_wxLuaBindMethod_table__call, 1); + lua_rawset(L, -3); + + //lua_pushstring(L, "__metatable"); + //lua_pushstring(L, "Metatable is not accessible"); + //lua_rawset(L, -3); + + if (!has_meta) + lua_setmetatable(L, -2); + else + lua_pop(L, 1); + + // add table to the binding table t[wxlMethod->name] = { this table } + lua_rawset(L, -3); // set t[key] = value, pops key and value + } + } + + return true; + } + + // --------------------------------------------------------------------------- + const wxLuaBindEvent* wxLuaBinding::GetBindEvent(wxEventType eventType_) const { Index: wxlua_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua_bind.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wxlua_bind.cpp 24 Jan 2008 00:18:18 -0000 1.22 --- wxlua_bind.cpp 25 Jan 2008 23:50:54 -0000 1.23 *************** *** 969,985 **** } ! void wxLuaBinding_wxlua::PreRegister(const wxLuaState& , int ) ! { ! } ! void wxLuaBinding_wxlua::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 } // --------------------------------------------------------------------------- --- 969,986 ---- } ! bool wxLuaBinding_wxlua::RegisterBinding(const wxLuaState& wxlState) { ! bool ret = wxLuaBinding::RegisterBinding(wxlState); ! 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 ! ! return ret; } + // --------------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2008-01-25 23:51:00
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/modules/wxluasocket/include Modified Files: wxluasocket_bind.h 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: wxluasocket_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxluasocket_bind.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wxluasocket_bind.h 24 Jan 2008 00:18:18 -0000 1.33 --- wxluasocket_bind.h 25 Jan 2008 23:50:54 -0000 1.34 *************** *** 31,40 **** public: wxLuaBinding_wxluasocket(); - virtual wxLuaBinding* Clone() const { return new wxLuaBinding_wxluasocket; } - protected: - virtual void PreRegister(const wxLuaState& wxlState, int luaTable); - virtual void PostRegister(const wxLuaState& wxlState, int luaTable); DECLARE_DYNAMIC_CLASS(wxLuaBinding_wxluasocket) }; --- 31,37 ---- public: wxLuaBinding_wxluasocket(); + private: DECLARE_DYNAMIC_CLASS(wxLuaBinding_wxluasocket) }; |
From: John L. <jr...@us...> - 2008-01-25 23:51:00
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1159/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxlstate.h wxlua_bind.h 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: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** wxlbind.h 24 Jan 2008 00:18:17 -0000 1.81 --- wxlbind.h 25 Jan 2008 23:50:52 -0000 1.82 *************** *** 19,22 **** --- 19,23 ---- class WXDLLIMPEXP_WXLUA wxLuaBinding; class WXDLLIMPEXP_WXLUA wxLuaState; + struct WXDLLIMPEXP_WXLUA wxLuaBindClass; // ---------------------------------------------------------------------------- *************** *** 51,62 **** #define WXLUA_TCFUNCTION 12 // LUA_TFUNCTION & lua_iscfunction(), not a LUA_TXXX ! #define WXLUA_TNULL 13 // C++ NULL ! #define WXLUA_T_MAX 13 // Max of the WXLUA_TXXX values ! #define WXLUA_T_MIN 0 // Min of the WXLUA_TXXX values ! // Blindly convert the lua_type to the wxlua_type. Note: WXLUA_TXXX = LUA_TXXX - 2 // *** See wxlua_luatowxluatype() for a better function *** ! #define LUAT_TO_WXLUAT(luatype) ((luatype) - 2) // Returns true if the wxLua type is for a wxLua binding type and not a --- 52,63 ---- #define WXLUA_TCFUNCTION 12 // LUA_TFUNCTION & lua_iscfunction(), not a LUA_TXXX ! #define WXLUA_T_MAX 12 // Max of the Lua WXLUA_TXXX values ! #define WXLUA_T_MIN 0 // Min of the Lua WXLUA_TXXX values ! #define WXLUA_TNULL 13 // C++ NULL, has metatable ! // Blindly convert the lua_type to the wxlua_type. Note: WXLUA_TXXX = LUA_TXXX + 2 // *** See wxlua_luatowxluatype() for a better function *** ! #define LUAT_TO_WXLUAT(luatype) ((luatype) + 2) // Returns true if the wxLua type is for a wxLua binding type and not a *************** *** 81,85 **** extern WXDLLIMPEXP_DATA_WXLUA(int) wxluatype_TCFUNCTION; ! extern WXDLLIMPEXP_DATA_WXLUA(int) wxluatype_NULL; // wxLua type for NULL pointer // Copies of wxLua types that are used very often. --- 82,87 ---- extern WXDLLIMPEXP_DATA_WXLUA(int) wxluatype_TCFUNCTION; ! extern WXDLLIMPEXP_DATA_WXLUA(int) wxluatype_NULL; // wxLua type for NULL pointer ! extern WXDLLIMPEXP_DATA_WXLUA(wxLuaBindClass) wxLuaBindClass_NULL; // for NULL pointer // Copies of wxLua types that are used very often. *************** *** 489,498 **** virtual ~wxLuaBinding() {} ! // override this to generate a "new" version of subclassed bindings ! virtual wxLuaBinding* Clone() const { return new wxLuaBinding; } ! ! // Binds C Functions/Defines/Object/Events to namespace Lua Table virtual bool RegisterBinding(const wxLuaState& wxlState); // ----------------------------------------------------------------------- --- 491,505 ---- virtual ~wxLuaBinding() {} ! // Binds C Functions/Defines/Object/Events to a Lua table with binding's namespace. ! // The Lua table that the bindings were installed into is left on the top ! // of the stack and you must pop it when done. virtual bool RegisterBinding(const wxLuaState& wxlState); + // Create the metatable for the class and install it into the Lua registry. + static bool InstallClassMetatable(lua_State* L, const wxLuaBindClass* wxlClass); + // Install a single wxLuaBindClass struct into the table at the top + // of the stack. + static bool InstallClass(lua_State* L, const wxLuaBindClass* wxlClass); + // ----------------------------------------------------------------------- *************** *** 602,614 **** // to sort the bindings appropriately ! // Register the classes, defines, strings, events, objects, and functions generated by the binding ! virtual void DoRegisterBinding(const wxLuaState& wxlState, int bind_table_idx); ! ! // Before registering anything from this binding this function is called ! // at the beginning of RegisterBinding(...) ! virtual void PreRegister(const wxLuaState& WXUNUSED(wxlState), int WXUNUSED(bind_table_idx)) {} ! // After registering everything from this binding this function is called ! // at the end of RegisterBinding(...) ! virtual void PostRegister(const wxLuaState& WXUNUSED(wxlState), int WXUNUSED(bind_table_idx)) {} // binding objects --- 609,616 ---- // to sort the bindings appropriately ! // Register the classes, defines, strings, events, objects, and functions ! // stored in the binding arrays. The Lua table to install them into ! // must be at the top of the stack. ! virtual void DoRegisterBinding(const wxLuaState& wxlState) const; // binding objects Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** wxlstate.h 24 Jan 2008 00:18:17 -0000 1.118 --- wxlstate.h 25 Jan 2008 23:50:52 -0000 1.119 *************** *** 864,868 **** wxLUA_UNICODE_ONLY(void RegisterFunction(lua_CFunction func, const wxString &funcName) { RegisterFunction(func, wx2lua(funcName)); }) ! // Register a single wxLuaBinding. bool RegisterBinding(wxLuaBinding* binding); // Register all the bindings in the wxLuaBinding::GetBindingList(), this is done --- 864,869 ---- wxLUA_UNICODE_ONLY(void RegisterFunction(lua_CFunction func, const wxString &funcName) { RegisterFunction(func, wx2lua(funcName)); }) ! // Register a single wxLuaBinding, returns true on success. Nothing is ! // left on the stack. bool RegisterBinding(wxLuaBinding* binding); // Register all the bindings in the wxLuaBinding::GetBindingList(), this is done Index: wxlua_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlua_bind.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wxlua_bind.h 24 Jan 2008 00:18:17 -0000 1.12 --- wxlua_bind.h 25 Jan 2008 23:50:53 -0000 1.13 *************** *** 27,36 **** public: wxLuaBinding_wxlua(); - virtual wxLuaBinding* Clone() const { return new wxLuaBinding_wxlua; } ! protected: ! virtual void PreRegister(const wxLuaState& wxlState, int luaTable); ! virtual void PostRegister(const wxLuaState& wxlState, int luaTable); DECLARE_DYNAMIC_CLASS(wxLuaBinding_wxlua) }; --- 27,34 ---- public: wxLuaBinding_wxlua(); ! virtual bool RegisterBinding(const wxLuaState& wxlState); + private: DECLARE_DYNAMIC_CLASS(wxLuaBinding_wxlua) }; |
From: John L. <jr...@us...> - 2008-01-24 04:54:00
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12538/wxLua/docs Modified Files: wxlua.html wxluaref.html Log Message: Update docs for changes in wxLua C++ api Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wxluaref.html 20 Jan 2008 19:23:01 -0000 1.47 --- wxluaref.html 24 Jan 2008 04:53:48 -0000 1.48 *************** *** 6815,6820 **** <font color=#009900>// bool Initialized() obsolete in wxWidgets</font><br> <br> ! <font color=#BB0055> <font color=#009900>// <i>%override</i> int wxApp::MainLoop() : Only calls it if !wxLuaState::sm_wxAppMainLoop_will_run, returns 0 if it is true.</font></font><br> <font color=#009900>// C++ Func: int MainLoop()</font><br> int MainLoop()<br> <br> --- 6815,6821 ---- <font color=#009900>// bool Initialized() obsolete in wxWidgets</font><br> <br> ! <font color=#BB0055> <font color=#009900>// <i>%override</i> int wxApp::MainLoop()</font></font><br> <font color=#009900>// C++ Func: int MainLoop()</font><br> + <font color=#009900>// Only calls it if (!IsMainLoopRuinning() && !wxLuaState::sm_wxAppMainLoop_will_run), returns 0 if not called.</font><br> int MainLoop()<br> <br> *************** *** 12067,12073 **** --- 12068,12079 ---- <a href="#wxBitmap">wxBitmap</a>(const <a href="#wxImage">wxImage</a> &image, int depth = -1)<br> <br> + <font color=#BB0055> <font color=#009900>// <i>%override</i> <a href="#wxBitmap">wxBitmap</a>(lua string, int width, int height, int depth)</font></font><br> <font color=#009900>// C++ Func: <a href="#wxBitmap">wxBitmap</a>(const char bits[], int width, int height, int depth = 1)</font><br> <font color=#009900>// Creates a bitmap from an array of bits in the form of a Lua string.</font><br> <font color=#BB0055> <i>%override_name</i> wxLua_wxBitmapFromBits_constructor <a href="#wxBitmap">wxBitmap</a>(const char* mono_bits, int width, int height, int depth <font color=#888888>/* = 1 */</font>);</font><br> + <font color=#BB0055> <font color=#009900>// <i>%override</i> <a href="#wxBitmap">wxBitmap</a>(LuaTable charTable, int width, int height, int depth)</font></font><br> + <font color=#009900>// C++ Func: <a href="#wxBitmap">wxBitmap</a>(const char bits[], int width, int height, int depth = 1)</font><br> + <font color=#009900>// Creates a bitmap from an array of chars in a Lua table.</font><br> + <font color=#BB0055> <i>%override_name</i> wxLua_wxBitmapFromBitTable_constructor <a href="#wxBitmap">wxBitmap</a>(LuaTable charTable, int width, int height, int depth <font color=#888888>/* = 1 */</font>);</font><br> <br> <font color=#BB0055> <font color=#009900>// <i>%override</i> <a href="#wxBitmap">wxBitmap</a>(LuaTable stringTable where each index is a row in the image)</font></font><br> *************** *** 24545,24548 **** --- 24551,24557 ---- <font color=#006666><i>%define</i> WXLUA_TINTEGER</font><br> <font color=#006666><i>%define</i> WXLUA_TCFUNCTION</font><br> + <font color=#006666><i>%define</i> WXLUA_TNULL</font><br> + <br> + <font color=#006666><i>%define</i> WXLUA_T_MAX</font><br> <br> <font color=#006666><i>%define</i> LUA_TNONE <font color=#009900>// (-1)</font></font><br> Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wxlua.html 18 Jan 2008 06:00:09 -0000 1.36 --- wxlua.html 24 Jan 2008 04:53:47 -0000 1.37 *************** *** 3,8 **** <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua Documentation</title> ! <meta content="John Labenski" name="author"> ! </head> <body> <h2><u>wxLua --- 3,7 ---- <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua Documentation</title> ! <meta content="John Labenski" name="author"></head> <body> <h2><u>wxLua *************** *** 17,21 **** running standalone wxLua ! scripts (wxLuaFreeze), a Lua module to load using "require" when using the standard Lua executable, and a library for --- 16,20 ---- running standalone wxLua ! scripts (wxLuaFreeze), a Lua module to load using <i>require("wx")</i> when using the standard Lua executable, and a library for *************** *** 29,37 **** fast, dynamic, and easy to learn. Lua contains a limited number of data types, ! mainly numbers, strings, functions, and tables. Perhaps the most powerful feature of the Lua language is that the tables can be used as either arrays ! or hashtables that can cross-reference numbers, strings, functions, and/or subtables.<br> --- 28,36 ---- fast, dynamic, and easy to learn. Lua contains a limited number of data types, ! mainly numbers, strings, functions, tables, and userdata. Perhaps the most powerful feature of the Lua language is that the tables can be used as either arrays ! or hash tables that can cross-reference numbers, strings, functions, and/or subtables.<br> *************** *** 397,401 **** <ul> <li>Note that the table is not returned, but modified ! inplace, also note that we can use table.insert() to append to a table instead of the above method.</li> --- 396,400 ---- <ul> <li>Note that the table is not returned, but modified ! in place, also note that we can use table.insert() to append to a table instead of the above method.</li> *************** *** 555,559 **** can be used as containers for input values to functions using the unpack(table, [i, [, j]]) function. This is useful for creating complex ! inputs to a function or storing them for resuse.</li> <ul> <li><span style="font-style: italic;">print(string.find(unpack({"Hello", --- 554,558 ---- can be used as containers for input values to functions using the unpack(table, [i, [, j]]) function. This is useful for creating complex ! inputs to a function or storing them for reuse.</li> <ul> <li><span style="font-style: italic;">print(string.find(unpack({"Hello", *************** *** 696,700 **** "string"). Functions that return wxStrings convert the value into a Lua string for convenience. The conversion from ! the Lua ANSI C 8-bit char* string to a wxString (which may be a unicode wchar* string) is done internally.<br> <br> --- 695,699 ---- "string"). Functions that return wxStrings convert the value into a Lua string for convenience. The conversion from ! the Lua ANSI C 8-bit char* string to a wxString (which may be a Unicode wchar* string) is done internally.<br> <br> *************** *** 720,731 **** arr" you must provide a wxArrayInt userdata since the C++ function will most likely modify the wxArrayInt that's passed to it. ! <ul> ! <li>Location of the wxWidgets objects declared in a ! C++ header files in the <i><b>wx</b></i> Lua ! table</li> ! <ul> <li><b>#define ! NUMBER_DEFINE VALUE</b> </li> ! <ul> <li>All #defined numerical values are available as <i>wx.NUMBER_DEFINE</i></li> --- 719,729 ---- arr" you must provide a wxArrayInt userdata since the C++ function will most likely modify the wxArrayInt that's passed to it. ! <br><br><b>Location of the wxWidgets objects declared in a ! C++ header files in the <i>wx</i> Lua ! table</b><ul> <li><b>#define ! NUMBER_DEFINE VALUE</b> </li><ul> ! ! <li>All #defined numerical values are available as <i>wx.NUMBER_DEFINE</i></li> *************** *** 736,743 **** tag<br> </li> ! </ul> ! <li><b>[int, ! double, etc] NUMBER_VARIABLE;</b></li> ! <ul> <li>All global numerical variables are available as <i>wx.NUMBER_VARIABLE</i></li> --- 734,741 ---- tag<br> </li> ! ! </ul><li><b>[int, ! double, etc] NUMBER_VARIABLE;</b></li><ul> ! <li>All global numerical variables are available as <i>wx.NUMBER_VARIABLE</i></li> *************** *** 747,754 **** in the bindings using the <i>%define</i> tag</li> ! </ul> ! <li><b>enum ENUM_NAMESPACE [or ! CLASSNAME::ENUM_NAMESPACE] { ENUM_NAME }</b></li> ! <ul> <li>All global enums, named or not, are available as <i>wx.ENUM_NAME</i></li> <ul> --- 745,752 ---- in the bindings using the <i>%define</i> tag</li> ! ! </ul><li><b>enum ENUM_NAMESPACE [or ! CLASSNAME::ENUM_NAMESPACE] { ENUM_NAME }</b></li><ul> ! <li>All global enums, named or not, are available as <i>wx.ENUM_NAME</i></li> <ul> *************** *** 765,777 **** <li>This follows the C++ semantics that you do not have to ! specify the name of an enum, but you do have to use it's scope if it is a class member.</li> <li>Declared in the bindings using the <i>%enum</i> tag</li> ! </ul> ! <li><b>#define ! STRING_DEFINE wxT("String Value")</b></li> ! <ul> <li>All #defined string values are available as <i>wx.STRING_DEFINE</i></li> --- 763,775 ---- <li>This follows the C++ semantics that you do not have to ! specify the name of an enum, but you do have to use its scope if it is a class member.</li> <li>Declared in the bindings using the <i>%enum</i> tag</li> ! ! </ul><li><b>#define ! STRING_DEFINE wxT("String Value")</b></li><ul> ! <li>All #defined string values are available as <i>wx.STRING_DEFINE</i></li> *************** *** 781,788 **** <li>Declared in the bindings using the <i>%define_string</i> tag</li> ! </ul> ! <li><b>const wxChar* ! STRING_VARIABLE;</b></li> ! <ul> <li>All global string variables are available as <i>wx.STRING_VARIABLE</i></li> --- 779,786 ---- <li>Declared in the bindings using the <i>%define_string</i> tag</li> ! ! </ul><li><b>const wxChar* ! STRING_VARIABLE;</b></li><ul> ! <li>All global string variables are available as <i>wx.STRING_VARIABLE</i></li> *************** *** 791,798 **** bindings using the <i>%define_string</i> tag</li> ! </ul> ! <li><b>wxEVT_XXX ! for wxEvtHandler::Connect()</b></li> ! <ul> <li>All <i>wxEVT_XXX</i> wxEventTypes (an integer) are --- 789,796 ---- bindings using the <i>%define_string</i> tag</li> ! ! </ul><li><b>wxEVT_XXX ! for wxEvtHandler::Connect()</b></li><ul> ! <li>All <i>wxEVT_XXX</i> wxEventTypes (an integer) are *************** *** 843,847 **** and then call <span style="font-style: italic;">dc:delete()</span> at the end of the function because the paint event clears the ! "dirty" region to repaint and if it's not cleared another paint event will be sent... and so on.</li> </ul> --- 841,845 ---- and then call <span style="font-style: italic;">dc:delete()</span> at the end of the function because the paint event clears the ! "dirty" region to repaint and if it is not cleared another paint event will be sent... and so on.</li> </ul> *************** *** 851,858 **** bindings using the <i>%define_event</i> tag</li> ! </ul> ! <li><b>Objects ! of classes or structs OBJECT_NAME</b></li> ! <ul> <li>All global objects that are classes or structs are --- 849,856 ---- bindings using the <i>%define_event</i> tag</li> ! ! </ul><li><b>Objects ! of classes or structs OBJECT_NAME</b></li><ul> ! <li>All global objects that are classes or structs are *************** *** 866,873 **** <li>Declared in the bindings using the <i>%define_object</i> tag</li> ! </ul> ! <li><b>Pointers to ! classes or structs POINTER_NAME</b></li> ! <ul> <li>All global pointers that are classes or structs are --- 864,871 ---- <li>Declared in the bindings using the <i>%define_object</i> tag</li> ! ! </ul><li><b>Pointers to ! classes or structs POINTER_NAME</b></li><ul> ! <li>All global pointers that are classes or structs are *************** *** 881,890 **** <li>Declared in the bindings using the <i>%define_object</i> tag</li> ! </ul> ! <li><b>Global<i> </i>C style functions ! VAR_TYPE FUNCTION_NAME(int a, const wxString& str)</b></li> ! <ul> <li>All global C style functions are available as <i>wx.FUNCTION_NAME(1, "Hello")</i></li> --- 879,888 ---- <li>Declared in the bindings using the <i>%define_object</i> tag</li> ! ! </ul><li><b>Global<i> </i>C style functions ! VAR_TYPE FUNCTION_NAME(int a, const wxString& str)</b></li><ul> ! <li>All global C style functions are available as <i>wx.FUNCTION_NAME(1, "Hello")</i></li> *************** *** 897,909 **** <li>Declared in the bindings using the <i>%function</i> tag</li> ! </ul> ! <li><b>C++ Classes ! CLASS_NAME</b></li> ! <ul> <li>All C++ classes are available as <i>wx.CLASS_NAME</i>, however in order to use one you must call one of the constructors first ! or get the class as a return value from another function call.</li> ! <ul> <li>Example : <i>"pt = wx.wxPoint(1, 2); pt2 = wx.wxPoint(pt)"</i>.</li> --- 895,907 ---- <li>Declared in the bindings using the <i>%function</i> tag</li> ! ! </ul><li><b>C++ Classes ! CLASS_NAME</b></li><ul> <li>All C++ classes are available as <i>wx.CLASS_NAME</i>, however in order to use one you must call one of the constructors first ! or get the class as a return value from another function call.</li><ul> ! ! <li>Example : <i>"pt = wx.wxPoint(1, 2); pt2 = wx.wxPoint(pt)"</i>.</li> *************** *** 925,933 **** constructor function itself you can use <i>wx.CLASS_NAME.new(...)</i> which is the constructor exposed as a Cfunction.</li> ! </ul> ! <li>The C++ class objects are pushed into Lua as a userdata wrapping a void* ! pointer to the C++ object.</li> ! <ul> <li>A special metatable is set on the userdata with these entries :</li> --- 923,931 ---- constructor function itself you can use <i>wx.CLASS_NAME.new(...)</i> which is the constructor exposed as a Cfunction.</li> ! ! </ul><li>The C++ class objects are pushed into Lua as a userdata wrapping a void* ! pointer to the C++ object.</li><ul> ! <li>A special metatable is set on the userdata with these entries :</li> *************** *** 950,961 **** used so wxLua can delete the C++ object if appropriate. </li> </ul> ! </ul> ! <li>Declared in the bindings using the <i>%class</i> ! tag</li> ! <li><span style="font-weight: bold;">Deleting class userdata</span> can be done using the wxLua added class ! member function delete().</li> ! <ul> <li>All classes that have the %delete binding tag will be eventually garbage collected --- 948,959 ---- used so wxLua can delete the C++ object if appropriate. </li> </ul> ! ! </ul><li>Declared in the bindings using the <i>%class</i> ! tag</li><li><span style="font-weight: bold;">Deleting class userdata</span> can be done using the wxLua added class ! member function delete().</li><ul> ! ! <li>All classes that have the %delete binding tag will be eventually garbage collected *************** *** 974,978 **** <li>This is really a MS Windows problem, in Win95 based systems the number that ! you could create was severly limited, but even in NT systems (XP) you will have problems if you've created hundreds of them. One visible sign that something is wrong is when controls, like menus, stop redrawing --- 972,976 ---- <li>This is really a MS Windows problem, in Win95 based systems the number that ! you could create was severely limited, but even in NT systems (XP, Vista) you will have problems if you've created hundreds of them. One visible sign that something is wrong is when controls, like menus, stop redrawing *************** *** 984,988 **** <li>Additionally, since the Lua userdata that wxLua pushes into Lua only store a void* ! pointer to the C++ classes, Lua only thinks they are of size void* which are on 32bit x86 machines only 8 bytes. --- 982,986 ---- <li>Additionally, since the Lua userdata that wxLua pushes into Lua only store a void* ! pointer to the C++ class object, Lua only thinks they are of size void* which are on 32bit x86 machines only 8 bytes. *************** *** 1004,1008 **** so they will collect until Lua runs its garbage collector.</li> <li>You can force garbage collection using <i>"collectgarbage("collect")"</i> ! in Lua, but this may cause pauses in your program's execution.</li> </ul> <li>This --- 1002,1009 ---- so they will collect until Lua runs its garbage collector.</li> <li>You can force garbage collection using <i>"collectgarbage("collect")"</i> ! in Lua, but this may cause pauses in your program's execution. It is a ! good idea to collect all the garbage at the end of your initialization ! function to at least start out with a clean slate since program ! startup time is usually not a concern.</li> </ul> <li>This *************** *** 1010,1015 **** <ul> <li style="font-weight: bold;">Must delete : ! wxDC, wxPaintDC any ! and ALL classed derived from a wxDC</li> <li><span style="font-weight: bold;">Must delete if > 50 : --- 1011,1015 ---- <ul> <li style="font-weight: bold;">Must delete : ! wxDC, wxPaintDC, and ALL classed derived from wxDC</li> <li><span style="font-weight: bold;">Must delete if > 50 : *************** *** 1036,1050 **** </ul> <li>How to tell how ! many userdata objects you currenty have? </li> <ul> <li>Call ! the function wxlua.LuaStackDialog() when you run you program using ! "wxlua.exe program.lua" or in wxLuaEdit.exe.</li> ! <li>This ! function requires that wxLuaDebug C++ library to be compiled with it so ! it does not work with wxLuaFreeze.exe.</li> ! </ul> </ul> ! <li><b>Member functions</b> of the class are called using the colon ':' convention and NOT the period --- 1036,1049 ---- </ul> <li>How to tell how ! many userdata objects you currently have?</li><ul><li>Print the output of <b><i>wxlua.GetGCUserdataInfo(true)</i></b> to show what objects will be garbage collected when their reference count goes to 0 and the Lua garbage collector runs.</li><li>Print the output of <i><b>wxlua.GetTrackedObjectInfo(true)</b></i> to get class objects that wxLua has pushed into Lua that may or may not be garbage collected.</li></ul> <ul> + <li>Call ! the function <b><i>wxlua.LuaStackDialog()</i></b> when you run ! your program and examine the items in the Lua LUA_REGISTRYINDEX table. ! Expand "wxLua objects pushed" and "wxLua gc objects to delete" tables.<br></li> </ul> ! ! </ul><li><b>Member functions</b> of the class are called using the colon ':' convention and NOT the period *************** *** 1059,1064 **** and <span style="font-weight: bold;">static</span> functions, please see the sections below about why they only use the ! '.' convention.</li> ! <ul> <li>Example : <i>"size = wx.wxSize(1, 2); size:SetWidth(10); size.SetHeight(size, 11); --- 1058,1063 ---- and <span style="font-weight: bold;">static</span> functions, please see the sections below about why they only use the ! '.' convention.</li><ul> ! <li>Example : <i>"size = wx.wxSize(1, 2); size:SetWidth(10); size.SetHeight(size, 11); *************** *** 1071,1080 **** original function. This is only done for special cases that would be awkward, if not impossible, to wrap otherwise.</li> ! </ul> ! <li><b>Property functions</b> allow you to read and/or write values to a class using the '.' convention and ! a shortened name.</li> ! <ul> <li>These are generated on the fly when the function --- 1070,1079 ---- original function. This is only done for special cases that would be awkward, if not impossible, to wrap otherwise.</li> ! ! </ul><li><b>Property functions</b> allow you to read and/or write values to a class using the '.' convention and ! a shortened name.</li><ul> ! <li>These are generated on the fly when the function *************** *** 1095,1100 **** a function using "()", but rather like accessing a table member, without the "()".</li> ! </ul> ! <ul> <li>Example : <i>"rect --- 1094,1099 ---- a function using "()", but rather like accessing a table member, without the "()".</li> ! ! <li>Example : <i>"rect *************** *** 1145,1157 **** necessary? Confusing? Useful? I'd stick with the Get/Set functions. - JL</li> ! </ul> ! <li><b>Member variables </b>allow you ! to read and/or write to member variables of a class.</li> ! <ul> <li>Declared in the interface files using the <i>%member</i> or <i>%member_func</i> tag.</li> ! </ul> ! <ul> <li>Example : In the interface file <i>gdi.i</i> --- 1144,1156 ---- necessary? Confusing? Useful? I'd stick with the Get/Set functions. - JL</li> ! ! </ul><li><b>Member variables </b>allow you ! to read and/or write to member variables of a class.</li><ul> ! <li>Declared in the interface files using the <i>%member</i> or <i>%member_func</i> tag.</li> ! ! <li>Example : In the interface file <i>gdi.i</i> *************** *** 1178,1189 **** only through the properties. </li> <li>If the member ! variable is conststant (const) the variable is read-only and you cannot set it's value.</li> ! </ul> ! <li><b>Static functions</b> are part of the table that holds the class and can be called with or without a class ! instance (a userdata).</li> ! <ul> <li>Example : <i>f = --- 1177,1188 ---- only through the properties. </li> <li>If the member ! variable is constant (const) the variable is read-only and you cannot set it's value.</li> ! ! </ul><li><b>Static functions</b> are part of the table that holds the class and can be called with or without a class ! instance (a userdata).</li><ul> ! <li>Example : <i>f = *************** *** 1199,1217 **** made to work reliably when you don't want or need the self pushed onto the stack. </li> ! </ul> ! <li><b>Enum members</b> are also part of the table that holds the class and are used by accessing the class table ! itself.</li> ! <ul> <li>Example : <i>"enum wxFTP::TransferMode { ASCII, ... }"</i> is accessible as <i>wx.wxFTP.ASCII</i></li> ! </ul> ! <li><b>Operator functions</b> allow you to use ! C++ operators in Lua. </li> ! <ul> <li>Lua has a limited set of operators, see the Lua --- 1198,1216 ---- made to work reliably when you don't want or need the self pushed onto the stack. </li> ! ! </ul><li><b>Enum members</b> are also part of the table that holds the class and are used by accessing the class table ! itself.</li><ul> ! <li>Example : <i>"enum wxFTP::TransferMode { ASCII, ... }"</i> is accessible as <i>wx.wxFTP.ASCII</i></li> ! ! </ul><li><b>Operator functions</b> allow you to use ! C++ operators in Lua. </li><ul> ! <li>Lua has a limited set of operators, see the Lua *************** *** 1236,1241 **** using the <i>%operator</i> tag.</li> ! </ul> ! <ul> <li><br> </li> --- 1235,1240 ---- using the <i>%operator</i> tag.</li> ! ! <li><br> </li> *************** *** 1282,1287 **** (unary)" = "op_neg"</li> <li></li> ! </ul> ! <ul> <li>"=" = op_set</li> <li>"+" = "op_add"<br> --- 1281,1286 ---- (unary)" = "op_neg"</li> <li></li> ! ! <li>"=" = op_set</li> <li>"+" = "op_add"<br> *************** *** 1340,1346 **** test if pt2 has changed, it hasn't, and the test to see if they're still equal and as expected, they're not.</li> ! </ul> ! <li style="font-weight: bold;">Virtual functions</li> ! <ul> <li>You cannot --- 1339,1345 ---- test if pt2 has changed, it hasn't, and the test to see if they're still equal and as expected, they're not.</li> ! ! </ul><li style="font-weight: bold;">Virtual functions</li><ul> ! <li>You cannot *************** *** 1369,1376 **** already been added is that there is a price to pay in terms of binding size and speed.</li> ! </ul> ! <li><span style="font-weight: bold;">Overriding ! member functions</span> with Lua functions</li> ! <ul> <li>You may override class member functions for a wxLua userdata and still be --- 1368,1375 ---- already been added is that there is a price to pay in terms of binding size and speed.</li> ! ! </ul><li><span style="font-weight: bold;">Overriding ! member functions</span> with Lua functions</li><ul> ! <li>You may override class member functions for a wxLua userdata and still be *************** *** 1391,1398 **** since otherwise you'll get recursion. </li> ! </ul> ! <li><b>Extending ! classes</b> </li> ! <ul> <li>You may add your --- 1390,1396 ---- since otherwise you'll get recursion. </li> ! ! </ul><li><b>Extending ! classes</b> </li><ul> <li>You may add your *************** *** 1401,1416 **** if you would like to keep functions that act on a particular class with it rather than having global functions that take that class as a ! parameter.</li> ! <li>Example : <i>"r = wx.wxRect(1,2,3,4); r.PrintXY = function(self) print(self:GetX(), self:GetY()) end; r:PrintXY()"</i> adds the function PrintXY() to the wxRect instance r. The userdata, class instance, r is passed to the Lua function as the parameter "self" which is pushed onto ! the stack when the PrintXY() function is called with the ":" notation.</li> ! <li>Note that the above example is the same as <i>"</i><i>r = wx.wxRect(1,2,3,4); </i><i>function wxRect_PrintXY(r) ! print(r:GetX(), r:GetY()) end; wxRect_PrintXY(r)"</i>.</li> ! <li>You may also create the Lua function beforehand and then assign it to the rect object. <i>"function --- 1399,1411 ---- if you would like to keep functions that act on a particular class with it rather than having global functions that take that class as a ! parameter.</li><li>Example : <i>"r = wx.wxRect(1,2,3,4); r.PrintXY = function(self) print(self:GetX(), self:GetY()) end; r:PrintXY()"</i> adds the function PrintXY() to the wxRect instance r. The userdata, class instance, r is passed to the Lua function as the parameter "self" which is pushed onto ! the stack when the PrintXY() function is called with the ":" notation.</li><li>Note that the above example is the same as <i>"</i><i>r = wx.wxRect(1,2,3,4); </i><i>function wxRect_PrintXY(r) ! print(r:GetX(), r:GetY()) end; wxRect_PrintXY(r)"</i>.</li><li>You may also create the Lua function beforehand and then assign it to the rect object. <i>"function *************** *** 1419,1423 **** You can see that using this idea you can write a Lua function that creates a new wxRect, sets your extra functions ! for it, and returns it for use.</li> <ul> </ul> --- 1414,1422 ---- You can see that using this idea you can write a Lua function that creates a new wxRect, sets your extra functions ! for it, and returns it for use.</li><ul> ! ! ! ! <ul> </ul> *************** *** 1448,1454 **** <br> Why are the samples named <span style="font-style: italic;">sample.wx.lua</span>? ! To allow them to be colorized correctly in syntax hilighting editors, yet denote to people that they are for wxLua and must ! be run using a wxLua exectuable or the wxLua module. <br> <h3><a name="How_to_run_the_samples"></a>How to Run the --- 1447,1453 ---- <br> Why are the samples named <span style="font-style: italic;">sample.wx.lua</span>? ! To allow them to be colorized correctly in syntax highlighting editors, yet denote to people that they are for wxLua and must ! be run using a wxLua executable or the wxLua module. <br> <h3><a name="How_to_run_the_samples"></a>How to Run the *************** *** 1474,1485 **** button to run it.</li> <li>Use ! wxLua as a Lua module (using require), run <span style="font-weight: bold; font-style: italic;">$lua.exe ! ../utils/wrapmodule/wrapmodule.wx.lua sample.wx.lua</span></li> <ul> ! <li>Note ! that <span style="font-weight: bold;">wrapmodule.wx.lua</span> ! is in the <span style="font-style: italic;">utils/wrapmodule</span> ! directory so you may have to specify a different path depending on ! where you are running lua.exe from. For more information see <a href="#wrapmodule.wx.lua">wrapmodule.wx.lua</a>. </li> </ul> </ul> --- 1473,1479 ---- button to run it.</li> <li>Use ! wxLua as a Lua module (using the function require), run <span style="font-weight: bold; font-style: italic;">$lua.exe sample.wx.lua</span></li> <ul> ! <li>In order to use wxLua as a module the Lua code must have <i>require("wx")</i> to load the wxLua bindings in the beginning and <i>wx.wxGetApp():MainLoop()</i> at the end to start the wxWidgets event loop.</li><li>You may need to adjust the <i>package.cpath</i> variable to have it point to the correct location of the wx.so or wx.dll shared library for require("wx") to load.</li> </ul> </ul> *************** *** 1493,1497 **** <li>Lets you explore the C++ binding structs from within Lua ! using a wxListCtrl. This is the raw data that is used to push the bindings into Lua when a wxLuaState is created.</li> <li>Take --- 1487,1491 ---- <li>Lets you explore the C++ binding structs from within Lua ! using a wxListCtrl. This program shows the raw data that is used to push the bindings into Lua when a wxLuaState is created.</li> <li>Take *************** *** 1770,1774 **** display print statements, run the string "a = 12; b = 3", then run myprogram.lua and push into lua a table named 'arg' with the ! indicies </li> <li>[-5] = 'd:\wxLua\bin\wxlua.exe', [-4] = '-c', [-3] --- 1764,1768 ---- display print statements, run the string "a = 12; b = 3", then run myprogram.lua and push into lua a table named 'arg' with the ! indices </li> <li>[-5] = 'd:\wxLua\bin\wxlua.exe', [-4] = '-c', [-3] *************** *** 1906,1910 **** necessary) for your paths.</li> <li>The list of paths is a ! semicolon separated list of paths to <span style="font-weight: bold;">?.so</span> (for unix type shared libraries) and <span style="font-weight: bold;">?.dll</span> (for MSW) .</li> --- 1900,1904 ---- necessary) for your paths.</li> <li>The list of paths is a ! semicolon separated list of paths to <span style="font-weight: bold;">?.so</span> (for Unix type shared libraries) and <span style="font-weight: bold;">?.dll</span> (for MSW) .</li> *************** *** 1913,1917 **** <li>You might ! as well include paths to both unix and MSW libraries so that the script can be run on either platform without modification since typically only the libraries that work on any given platform will be installed.</li> --- 1907,1911 ---- <li>You might ! as well include paths to both unfix and MSW libraries so that the script can be run on either platform without modification since typically only the libraries that work on any given platform will be installed.</li> *************** *** 1967,1973 **** throw out the whole library when linking unless you explicitly use something in it. Replace the XXX with the name of the library you want ! installed, see modules/wxbind/include/wxbinddefs.h for a list of them ! and some helpful macros to make it easy to install a standard set of ! them or all of them. </li> <li>Compilation of this module generates a number of --- 1961,1966 ---- throw out the whole library when linking unless you explicitly use something in it. Replace the XXX with the name of the library you want ! installed, see modules/wxbind/include/wxbinddefs.h for a list of them.</li><li>You should preferably use the macros in modules/wxbind/include/wxbinddefs.h to make it easy to install a standard set of ! them or all of them. They do some simple checks to determine if the binding will be available based on the wxWidgets wxUSE_XXX directives.</li> <li>Compilation of this module generates a number of *************** *** 2072,2078 **** The wxLuaState contains all of the Lua 'C' functions, such as lua_gettop(lua_State* L), but as member functions named lua_GetTop() ! which use the internal lua_State and check for it's validity before use ! when ! compiled in debug mode. The functions are capitalized to make them easier to find in an editor. If you want the greatest performance just use wxLuaState::GetLuaState() and directly manipulate the --- 2065,2069 ---- The wxLuaState contains all of the Lua 'C' functions, such as lua_gettop(lua_State* L), but as member functions named lua_GetTop() ! which use the internal lua_State and check for it's validity before use. The functions are capitalized to make them easier to find in an editor. If you want the greatest performance just use wxLuaState::GetLuaState() and directly manipulate the *************** *** 2095,2098 **** --- 2086,2090 ---- setting up the lua_State.</li> <ol> + <li>The wxObject::m_refData is created as a new wxLuaStateRefData(). This ref *************** *** 2103,2112 **** will all share the same wxLuaStateData class.</li> <li>The - wxLuaStateData constructor makes a copy of the static binding list, - wxLuaBinding::GetBindingList(), using wxLuaBinding::Clone() - function so that the member variables of the wxLuaBindings are - independent for each wxLuaState, however the binding data structs are - not since they are too large to make full copies of them.</li> - <li>The C lua_State is added to a hash table to allow --- 2095,2098 ---- *************** *** 2137,2158 **** <ul> </ul> <ul> <li>Each ! binding that is loaded are copies of derived wxLuaBinding ! classes that are installed into a wxList when the wxLuaBinding_XXX_init() functions ! are called when the application is initialized (see above about the ! wxbind module).</li> ! </ul> ! <ul> ! <li>YOU ! MUST ALWAYS KEEP THE ! SAME BINDINGS AND KEEP THEM IN ! THE SAME ORDER THROUGHOUT THE LIFE OF YOUR WXLUASTATES. This is because ! there is only one global int for each wxLua type and if ! you change the bindings (or their order) and create a new wxLuaState ! any previously ! created wxLuaStates will lookup classes using the wrong overwritten ! type.</li> </ul> <ol> --- 2123,2138 ---- <ul> </ul> + <ul> <li>Each ! binding that is loaded are derived wxLuaBinding ! classes whose member data variables point to structs in each binding. A ! single static instance of each binding class are installed ! into a wxList when the wxLuaBinding_XXX_init() functions ! are called. The reason behind the need for running the init function ! from the binding libraries is to stop certain compilers from throwing ! out the whole binding library, which happens even if the binding was ! added to the list from within the library.</li> </ul> <ol> *************** *** 2192,2196 **** considerable amount of the total time of a function call.<br> <br> ! <pre>// Light userdata used as keys in the Lua LUA_REGISTRYINDEX table for wxLua items.<br>// Note that even though these keys have values, they're not used, just the memory address.<br><br>// The key in the LUA_REGISTRYINDEX table that is a table indexed<br>// on the wxLua types where each item is a userdata metatable for a C++ class.<br>// Note: The wxLua types WXLUA_TXXX that correspond to the Lua LUA_TXXX types<br>// are not stored in this table since they do not use our metatables.<br>// The keys in this table are all > 1.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_types_key][wxLua type number] = { metatable for a C++ class }<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_types_key;<br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table<br>// with references to Lua objects we want to keep a handle to. The object could be<br>// anything, a table, function, number, string, userdata...<br>// LUA_REGISTRYINDEX[&wxlua_lreg_refs_key][ref number] = Lua object<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_refs_key;<br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table<br>// with references to objects the wxLuaDebugData wants to keep a handle to. It<br>// stores their value for faster lookup. It is used only for the wxLuaDebugData.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][ref number] = Lua object<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_debug_refs_key;<br>// The key that in the LUA_REGISTRYINDEX table that is a table of<br>// C++ classname keys and lightuserdata pointers to the associated wxLuaBindClass.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][wxLuaBindClass.name] = lightuserdata(&wxLuaBindClass)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_classes_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table<br>// of Lua functions assigned to wxLua userdata programatically in Lua.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_derivedmethods_key][lightuserdata(obj_ptr)] =<br>// {["derived func/value name"] = wxLuaObject(Lua function/value), ...}<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_derivedmethods_key;<br>// The key in the LUA_REGISTRYINDEX table who's value is a lightuserdata<br>// of the wxLuaState for this lua_State.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluastate_key] = lightuserdata(&wxLuaState)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluastate_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// objects that we've pushed into Lua using wxluaT_pushuserdatatype().<br>// Note: A single object like a wxWindow may be pushed with multiple wxLua types.<br>// e.g. wxWindow* w = wx.wxWindow() retrieve the window later from wxObject* wxEvent:GetEventObject()<br>// LUA_REGISTRYINDEX[&wxlua_lreg_weakobjects_key][lightuserdata(obj_ptr)] =<br>// { wxLua type1 = weak fulluserdata, wxLua type2 = weak fulluserdata... }<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_weakobjects_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// objects tracked using wxluaO_addgcobject() to delete them when done.<br>// Note that non wxObject classes use wxLUA_DECLARE_ENCAPSULATION so<br>// the key is the object pointer and the value is the wxObject encapsulation.<br>// Both the key and the value are the same if not encapsulated .<br>// LUA_REGISTRYINDEX[&wxlua_lreg_gcobjects_key][lightuserdata(obj_ptr)] =<br>// lightuserdata(wxObject derived class)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_gcobjects_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// wxLuaEventCallbacks that we've created.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_evtcallbacks_key][lightuserdata(&wxLuaEventCallback)] =<br>// lightuserdata(&wxEvtHandler)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_evtcallbacks_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// wxLuaWinDestroyCallbacks that we've created.<br>// Two key/value pairs are created for fast lookup.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_windestroycallbacks_key][lightuserdata(&wxLuaWinDestroyCallback)] = 1<br>// LUA_REGISTRYINDEX[&wxlua_lreg_windestroycallbacks_key][lightuserdata(&wxWindow)] =<br>// lightuserdata(wxLuaWinDestroyCallback)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_windestroycallbacks_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// top level wxWindows that we've created and need to destroy when closed.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_topwindows_key][lightuserdata(&wxWindow)] = 1<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_topwindows_key;<br>// The key in the LUA_REGISTRYINDEX table that has a boolean value<br>// of whether the Lua code has prepended a '_' to function name to indicate<br>// that they want the base class function called.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_callbaseclassfunc_key] = true/false<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_callbaseclassfunc_key;<br>// The key in the LUA_REGISTRYINDEX table that has a wxEventType (integer) value<br>// of the current wxEvent is that is being run or wxEVT_NULL if not in an event.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxeventtype_key] = wxEventType (wxEVT_NULL)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxeventtype_key;<br>// The key in the LUA_REGISTRYINDEX table that has a wxLuaDebugHookData<br>// lightuserdata value for the wxLuaState.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluadebughookdata_key] = lightuserdata(&wxLuaDebugHookData)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluadebughookdata_key;<br>// The key in the LUA_REGISTRYINDEX table that is a weak keyed table of<br>// the tables wxLua pushed into the registry with their keys as values.<br>// This is used by the wxLuaDebugData to know if the table is one of the wxLua<br>// registry tables for better wxLuaStackDialog performance.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_regtable_key][weak {wxlua_lreg_XXX_key table}] =<br>// lightuserdata(&wxlua_lreg_XXX_key)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_regtable_key;<br><br>// Light userdata used as keys in the metatables created for the class userdata objects.<br>// Note that even though these keys have values, they're not used, just the memory address.<br><br>// wxLua userdata metatable structure:<br>// {<br>// lightuserdata(&wxlua_metatable_type_key) = wxLua type number in wxlua_lreg_types_key table<br>// lightuserdata(&wxlua_metatable_wxluabindclass_key) = lightuserdata(&wxLuaBindClass)<br>// __gc = function(wxlua_wxLuaBindClass__gc)<br>// __index = function(wxlua_wxLuaBindClass__index)<br>// __newindex = function(wxlua_wxLuaBindClass__newindex)<br>// __tostring = function(wxlua_wxLuaBindClass__tostring)<br>// }<br><br>// The key of a metatable used for wxLua userdata that is the wxLua type number in the<br>// wxlua_lreg_types_key table this metatable is for.<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_metatable_type_key;<br>// The key of a metatable used for wxLua userdata that stores a lightuserdata<br>// of the wxLuaBindClass struct for this class.<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_metatable_wxluabindclass_key;<br></pre> <h3><a name="Functions_to_Create_a_wxLuaState"></a>Functions to --- 2172,2176 ---- considerable amount of the total time of a function call.<br> <br> ! <pre>// ----------------------------------------------------------------------------<br>// Special keys used by wxLua in the LUA_REGISTRYINDEX table.<br>//<br>// Note: We do not push a human readable string for these because Lua always<br>// makes a copy and hashes the string, this takes a considerable amount of<br>// time when benchmarked using valgrind.<br>// ----------------------------------------------------------------------------<br><br>// Light userdata used as keys in the Lua LUA_REGISTRYINDEX table for wxLua.<br>// Note that even though these keys have values, they're not used, just the memory address.<br><br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table indexed<br>// on the wxLua types where each item is a userdata metatable for a C++ class.<br>// Note: The wxLua types WXLUA_TXXX that correspond to the Lua LUA_TXXX types<br>// are not stored in this table since they do not use our metatables.<br>// The keys in this table are all > 1. They values are either tables or 0<br>// if the wxLuaBinding containing the wxLua type was not registered.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_types_key][wxLua type number] = { metatable for a C++ class }<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_types_key;<br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table<br>// with references to Lua objects we want to keep a handle to. The object could be<br>// anything, a table, function, number, string, userdata...<br>// LUA_REGISTRYINDEX[&wxlua_lreg_refs_key][ref number] = Lua object<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_refs_key;<br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table<br>// with references to objects the wxLuaDebugData wants to keep a handle to by<br>// storing their value for lookup. It is used only for the wxLuaDebugData.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][ref number] = Lua object<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_debug_refs_key;<br>// The key that in the LUA_REGISTRYINDEX table that is a lookup table of string<br>// C++ classname keys and lightuserdata pointers to the associated wxLuaBindClass struct.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][wxLuaBindClass.name] = lightuserdata(&wxLuaBindClass)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_classes_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table<br>// of Lua objects/functions assigned to wxLua userdata programatically in Lua.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_derivedmethods_key][lightuserdata(obj_ptr)] =<br>// {["derived func/value name"] = wxLuaObject(Lua function/value), ...}<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_derivedmethods_key;<br>// The key in the LUA_REGISTRYINDEX table who's value is a lightuserdata<br>// of the wxLuaState for this lua_State.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluastate_key] = lightuserdata(&wxLuaState)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluastate_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of lightuserdata<br>// wxLuaBindings and the ref to the Lua table they were installed into.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluabindings_key] = {lightuserdata(&wxLuaBinding) = wxlua_lreg_refs_key ref#, ...}<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluabindings_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of all<br>// objects that we've pushed into Lua using wxluaT_pushuserdatatype().<br>// Note: A single object like a wxWindow may be pushed with multiple wxLua types.<br>// e.g. wxWindow* w = wx.wxWindow() retrieve the window later from wxObject* wxEvent:GetEventObject()<br>// LUA_REGISTRYINDEX[&wxlua_lreg_weakobjects_key][lightuserdata(obj_ptr)] =<br>// { wxLua type1 = weak fulluserdata, wxLua type2 = weak fulluserdata... }<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_weakobjects_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of all<br>// objects to delete that were added using wxluaO_addgcobject().<br>// Note that non wxObject classes use wxLUA_DECLARE_ENCAPSULATION so<br>// the key is the object pointer and the value is the wxObject encapsulation.<br>// Both the key and the value are the same if not encapsulated.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_gcobjects_key][lightuserdata(obj_ptr)] =<br>// lightuserdata(wxObject derived class)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_gcobjects_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of all<br>// wxLuaEventCallbacks that we've created.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_evtcallbacks_key][lightuserdata(&wxLuaEventCallback)] =<br>// lightuserdata(&wxEvtHandler)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_evtcallbacks_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of wxWindow keys and<br>// wxLuaWinDestroyCallback values that we've created.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_windestroycallbacks_key][lightuserdata(&wxWindow)] =<br>// lightuserdata(wxLuaWinDestroyCallback)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_windestroycallbacks_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of all<br>// top level wxWindows that we've created and need to destroy when closed.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_topwindows_key][lightuserdata(&wxWindow)] = 1<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_topwindows_key;<br>// The key in the LUA_REGISTRYINDEX table that has a boolean value<br>// of whether the Lua code has prepended a '_' to function name to indicate<br>// that they want the base class function called.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_callbaseclassfunc_key] = true/false<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_callbaseclassfunc_key;<br>// The key in the LUA_REGISTRYINDEX table that has a wxEventType (integer) value<br>// of the current wxEvent is that is being run or wxEVT_NULL if not in an event.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxeventtype_key] = wxEventType (wxEVT_NULL)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxeventtype_key;<br>// The key in the LUA_REGISTRYINDEX table that has a wxLuaStateData class<br>// lightuserdata value for the wxLuaState.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluastatedata_key] = lightuserdata(&wxLuaStateData)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluastatedata_key;<br>// The key in the LUA_REGISTRYINDEX table that is a weak keyed table of<br>// the tables wxLua pushed into the registry with their keys as values.<br>// This is used by the wxLuaDebugData to know if the table is one of the wxLua<br>// registry tables for better wxLuaStackDialog performance.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_regtable_key][weak {wxlua_lreg_XXX_key table}] =<br>// lightuserdata(&wxlua_lreg_XXX_key)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_regtable_key;<br><br>// Light userdata used as keys in the metatables created for the class userdata objects.<br>// Note that even though these keys have values, they're not used, just the memory address.<br><br>// wxLua userdata metatable structure:<br>// {<br>// lightuserdata(&wxlua_metatable_type_key) = wxLua type number in wxlua_lreg_types_key table<br>// lightuserdata(&wxlua_metatable_wxluabindclass_key) = lightuserdata(&wxLuaBindClass)<br>// __gc = function(wxlua_wxLuaBindClass__gc)<br>// __index = function(wxlua_wxLuaBindClass__index)<br>// __newindex = function(wxlua_wxLuaBindClass__newindex)<br>// __tostring = function(wxlua_wxLuaBindClass__tostring)<br>// }<br><br>// The key of a metatable used for wxLua userdata that is the wxLua type number in the<br>// wxlua_lreg_types_key table this metatable is for.<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_metatable_type_key;<br>// The key of a metatable used for wxLua userdata that stores a lightuserdata<br>// of the wxLuaBindClass struct for this class.<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_metatable_wxluabindclass_key;<br><br></pre> <h3><a name="Functions_to_Create_a_wxLuaState"></a>Functions to *************** *** 2214,2230 **** get and handle the wxLuaEvents, see also Get/SetEventHandler().</li> </ul> ! <li>wxLuaState(lua_State* L, wxLuaState_Type type = ! WXLUASTATE_ATTACH)</li> <ul> ! <li>type = ! WXLUASTATE_ATTACH means that the lua_State must already have been created using a wxLuaState and so this new wxLuaState will merely attach to the corresponding ref data.</li> <li>type ! = WXLUASTATE_SETSTATE means that this new lua_State ! that you have created will have the wxLua bindings pushed into it and then be ready for running wxLua programs. The wxLuaState will not close the lua_State, but will remove itself from Lua and do cleanup when ! there are no more instances of them.</li> </ul> </ul> --- 2194,2208 ---- get and handle the wxLuaEvents, see also Get/SetEventHandler().</li> </ul> ! <li>wxLuaState(lua_State* L, wxLuaState_Type type = wxLUASTATE_GETSTATE)</li> <ul> ! <li>type = wxLUASTATE_GETSTATE means that the lua_State must already have been created using a wxLuaState and so this new wxLuaState will merely attach to the corresponding ref data.</li> <li>type ! = wxLUASTATE_SETSTATE means that this new lua_State ! that you have created will have the wxLua bindings pushed into it if wxLUASTATE_OPENBINDINGS is set and then be ready for running wxLua programs. The wxLuaState will not close the lua_State, but will remove itself from Lua and do cleanup when ! there are no more instances of them if wxLUASTATE_STATICSTATE is set.</li> </ul> </ul> *************** *** 2275,2277 **** other functions which are documented in <span style="font-style: italic;">wxLua/modules/wxlua/include/wxlstate.h</span>.</li> </ul> ! </body></html> --- 2253,2255 ---- other functions which are documented in <span style="font-style: italic;">wxLua/modules/wxlua/include/wxlstate.h</span>.</li> </ul> ! </body></html> \ No newline at end of file |
From: John L. <jr...@us...> - 2008-01-24 00:19:09
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6513/wxLua/docs Modified Files: changelog.txt 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: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** changelog.txt 20 Jan 2008 19:23:01 -0000 1.59 --- changelog.txt 24 Jan 2008 00:19:07 -0000 1.60 *************** *** 90,95 **** The new term for the C++ objects that wxLua wraps in Lua userdata and assigns a metatable to are wxLua types. ! wxLua types < 0, the WXLUA_TXXX types, correspond to the LUA_TXXX Lua types. ! wxLua types > 0 are types from the bindings and denote a class or struct. - Most notably for people who have written their own overrides for their bindings will be that wxLuaState::PushUserTag() is now wxluaT_PushUserDataType(). --- 90,95 ---- The new term for the C++ objects that wxLua wraps in Lua userdata and assigns a metatable to are wxLua types. ! WXLUA_TXXX types < WXLUA_T_MAX correspond to the LUA_TXXX Lua types. ! wxLua types > WXLUA_T_MAX are types from the bindings and denote a class or struct. - Most notably for people who have written their own overrides for their bindings will be that wxLuaState::PushUserTag() is now wxluaT_PushUserDataType(). *************** *** 113,117 **** replaced them with the C functions wxlua_errorinfo() and wxlua_LUA_ERR_msg() respectively. ! - Added wxlua_pushargs(wxChar**, int) for a standard way to push args into Lua. - Copy Lua's print() function to print_lua() instead of simply --- 113,117 ---- replaced them with the C functions wxlua_errorinfo() and wxlua_LUA_ERR_msg() respectively. ! - Added wxlua_pushargs(wxChar**, int) for a standard way to push args into Lua. - Copy Lua's print() function to print_lua() instead of simply *************** *** 122,126 **** each wxWidgets library when --enable-wxbind* options are left in "auto" mode ! * Updated Lua to 5.1.3-rc1 - Added static bool wxLuaState::sm_wxAppMainLoop_will_run so that Lua code --- 122,126 ---- each wxWidgets library when --enable-wxbind* options are left in "auto" mode ! * Updated Lua to 5.1.3-rc1 - Added static bool wxLuaState::sm_wxAppMainLoop_will_run so that Lua code *************** *** 128,131 **** --- 128,144 ---- should call it if they create a wxLuaState and run Lua code from their wxApp:OnInit() when wxApp:IsMainLoopRunning() returns false. + See the apps for usage. + + * 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. version 2.8.4.2 |
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 ---- |
From: John L. <jr...@us...> - 2008-01-24 00:18:50
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/modules/wxbind/include Modified Files: wxadv_bind.h wxaui_bind.h wxbase_bind.h wxcore_bind.h wxgl_bind.h wxhtml_bind.h wxmedia_bind.h wxnet_bind.h wxrichtext_bind.h wxstc_bind.h wxxml_bind.h wxxrc_bind.h 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: wxadv_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxadv_bind.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxadv_bind.h 23 Jan 2008 06:43:35 -0000 1.10 --- wxadv_bind.h 24 Jan 2008 00:18:15 -0000 1.11 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxadv to a single wxLuaState - extern WXDLLIMPEXP_BINDWXADV bool wxLuaBinding_wxadv_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxadv for all wxLuaStates extern WXDLLIMPEXP_BINDWXADV bool wxLuaBinding_wxadv_init(); --- 41,44 ---- Index: wxcore_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxcore_bind.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wxcore_bind.h 23 Jan 2008 06:43:35 -0000 1.11 --- wxcore_bind.h 24 Jan 2008 00:18:15 -0000 1.12 *************** *** 38,44 **** // 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 // --------------------------------------------------------------------------- --- 38,44 ---- // 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 // --------------------------------------------------------------------------- *************** *** 58,63 **** - // bind wxLuaBinding_wxcore to a single wxLuaState - extern WXDLLIMPEXP_BINDWXCORE bool wxLuaBinding_wxcore_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxcore for all wxLuaStates extern WXDLLIMPEXP_BINDWXCORE bool wxLuaBinding_wxcore_init(); --- 58,61 ---- Index: wxrichtext_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxrichtext_bind.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxrichtext_bind.h 23 Jan 2008 06:43:35 -0000 1.10 --- wxrichtext_bind.h 24 Jan 2008 00:18:16 -0000 1.11 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxrichtext to a single wxLuaState - extern WXDLLIMPEXP_BINDWXRICHTEXT bool wxLuaBinding_wxrichtext_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxrichtext for all wxLuaStates extern WXDLLIMPEXP_BINDWXRICHTEXT bool wxLuaBinding_wxrichtext_init(); --- 41,44 ---- Index: wxxrc_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxxrc_bind.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxxrc_bind.h 23 Jan 2008 06:43:35 -0000 1.10 --- wxxrc_bind.h 24 Jan 2008 00:18:16 -0000 1.11 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxxrc to a single wxLuaState - extern WXDLLIMPEXP_BINDWXXRC bool wxLuaBinding_wxxrc_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxxrc for all wxLuaStates extern WXDLLIMPEXP_BINDWXXRC bool wxLuaBinding_wxxrc_init(); --- 41,44 ---- Index: wxnet_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxnet_bind.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxnet_bind.h 23 Jan 2008 06:43:35 -0000 1.10 --- wxnet_bind.h 24 Jan 2008 00:18:16 -0000 1.11 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxnet to a single wxLuaState - extern WXDLLIMPEXP_BINDWXNET bool wxLuaBinding_wxnet_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxnet for all wxLuaStates extern WXDLLIMPEXP_BINDWXNET bool wxLuaBinding_wxnet_init(); --- 41,44 ---- Index: wxbase_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxbase_bind.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wxbase_bind.h 23 Jan 2008 06:43:35 -0000 1.11 --- wxbase_bind.h 24 Jan 2008 00:18:15 -0000 1.12 *************** *** 20,26 **** // 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 // --------------------------------------------------------------------------- --- 20,26 ---- // 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 // --------------------------------------------------------------------------- *************** *** 40,45 **** - // bind wxLuaBinding_wxbase to a single wxLuaState - extern WXDLLIMPEXP_BINDWXBASE bool wxLuaBinding_wxbase_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxbase for all wxLuaStates extern WXDLLIMPEXP_BINDWXBASE bool wxLuaBinding_wxbase_init(); --- 40,43 ---- Index: wxmedia_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxmedia_bind.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxmedia_bind.h 23 Jan 2008 06:43:35 -0000 1.10 --- wxmedia_bind.h 24 Jan 2008 00:18:16 -0000 1.11 *************** *** 22,28 **** // 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 // --------------------------------------------------------------------------- --- 22,28 ---- // 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 // --------------------------------------------------------------------------- *************** *** 42,47 **** - // bind wxLuaBinding_wxmedia to a single wxLuaState - extern WXDLLIMPEXP_BINDWXMEDIA bool wxLuaBinding_wxmedia_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxmedia for all wxLuaStates extern WXDLLIMPEXP_BINDWXMEDIA bool wxLuaBinding_wxmedia_init(); --- 42,45 ---- Index: wxgl_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxgl_bind.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxgl_bind.h 23 Jan 2008 06:43:35 -0000 1.10 --- wxgl_bind.h 24 Jan 2008 00:18:15 -0000 1.11 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxgl to a single wxLuaState - extern WXDLLIMPEXP_BINDWXGL bool wxLuaBinding_wxgl_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxgl for all wxLuaStates extern WXDLLIMPEXP_BINDWXGL bool wxLuaBinding_wxgl_init(); --- 41,44 ---- Index: wxstc_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxstc_bind.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxstc_bind.h 23 Jan 2008 06:43:35 -0000 1.10 --- wxstc_bind.h 24 Jan 2008 00:18:16 -0000 1.11 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxstc to a single wxLuaState - extern WXDLLIMPEXP_BINDWXSTC bool wxLuaBinding_wxstc_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxstc for all wxLuaStates extern WXDLLIMPEXP_BINDWXSTC bool wxLuaBinding_wxstc_init(); --- 41,44 ---- Index: wxaui_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxaui_bind.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wxaui_bind.h 23 Jan 2008 06:43:35 -0000 1.11 --- wxaui_bind.h 24 Jan 2008 00:18:15 -0000 1.12 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxaui to a single wxLuaState - extern WXDLLIMPEXP_BINDWXAUI bool wxLuaBinding_wxaui_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxaui for all wxLuaStates extern WXDLLIMPEXP_BINDWXAUI bool wxLuaBinding_wxaui_init(); --- 41,44 ---- Index: wxhtml_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxhtml_bind.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wxhtml_bind.h 23 Jan 2008 06:43:35 -0000 1.11 --- wxhtml_bind.h 24 Jan 2008 00:18:16 -0000 1.12 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxhtml to a single wxLuaState - extern WXDLLIMPEXP_BINDWXHTML bool wxLuaBinding_wxhtml_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxhtml for all wxLuaStates extern WXDLLIMPEXP_BINDWXHTML bool wxLuaBinding_wxhtml_init(); --- 41,44 ---- Index: wxxml_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxxml_bind.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxxml_bind.h 23 Jan 2008 06:43:35 -0000 1.10 --- wxxml_bind.h 24 Jan 2008 00:18:16 -0000 1.11 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxxml to a single wxLuaState - extern WXDLLIMPEXP_BINDWXXML bool wxLuaBinding_wxxml_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxxml for all wxLuaStates extern WXDLLIMPEXP_BINDWXXML bool wxLuaBinding_wxxml_init(); --- 41,44 ---- |
From: John L. <jr...@us...> - 2008-01-24 00:18:48
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/bindings/wxlua Modified Files: override.hpp wxlua.i 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: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua.i,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxlua.i 5 Jan 2008 00:15:45 -0000 1.15 --- wxlua.i 24 Jan 2008 00:18:15 -0000 1.16 *************** *** 87,90 **** --- 87,93 ---- %define WXLUA_TINTEGER %define WXLUA_TCFUNCTION + %define WXLUA_TNULL + + %define WXLUA_T_MAX %define LUA_TNONE // (-1) Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** override.hpp 23 Jan 2008 06:43:34 -0000 1.18 --- override.hpp 24 Jan 2008 00:18:15 -0000 1.19 *************** *** 149,158 **** static int LUACALL wxLua_function_GetBindings(lua_State *L) { - wxLuaState wxlState(L); lua_newtable(L); // the table that we return int idx = 1; wxLuaBindingList::compatibility_iterator node; ! for (node = wxlState.GetLuaBindingList()->GetFirst(); node; node = node->GetNext(), idx++) { wxLuaBinding* binding = node->GetData(); --- 149,157 ---- static int LUACALL wxLua_function_GetBindings(lua_State *L) { lua_newtable(L); // the table that we return int idx = 1; wxLuaBindingList::compatibility_iterator node; ! for (node = wxLuaBinding::GetBindingList()->GetFirst(); node; node = node->GetNext(), idx++) { wxLuaBinding* binding = node->GetData(); |
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 ---- |
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 ---- |
From: John L. <jr...@us...> - 2008-01-24 00:18:24
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/modules/wxluasocket/src Modified Files: wxluasocket_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: wxluasocket_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket_bind.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** wxluasocket_bind.cpp 23 Jan 2008 06:43:40 -0000 1.26 --- wxluasocket_bind.cpp 24 Jan 2008 00:18:19 -0000 1.27 *************** *** 161,165 **** m_objectArray = wxLuaGetObjectList_wxluasocket(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxluasocket(m_functionCount); - InitBinding(); } --- 161,164 ---- *************** *** 173,193 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxluasocket_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("wxluasocket"))); - - // ignore binding request when we already have wxluasocket registered - if (wxlState.GetLuaBinding(wxT("wxluasocket"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxluasocket()); - - return true; - } - bool wxLuaBinding_wxluasocket_init() { --- 172,175 ---- |
From: John L. <jr...@us...> - 2008-01-24 00:18:24
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxldefs.h wxlstate.h wxlua_bind.h 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: wxldefs.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxldefs.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wxldefs.h 23 Jan 2008 06:43:38 -0000 1.42 --- wxldefs.h 24 Jan 2008 00:18:17 -0000 1.43 *************** *** 65,69 **** //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 22 // ---------------------------------------------------------------------------- --- 65,69 ---- //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 23 // ---------------------------------------------------------------------------- Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** wxlbind.h 23 Jan 2008 06:43:38 -0000 1.80 --- wxlbind.h 24 Jan 2008 00:18:17 -0000 1.81 *************** *** 546,574 **** // ----------------------------------------------------------------------- ! // These functions search through the input wxLuaBindingList or if NULL ! // the static wxLuaBinding::GetBindingList(). // Get the installed wxLuaBinding with the given // wxLuaBinding::GetBindingName() or NULL for no match. ! static wxLuaBinding* GetLuaBinding(const wxString& bindingName, const wxLuaBindingList* bindingList); // Get wxLuaBindClass for given wxLua type using wxLuaBindClass::wxluatype, // returns NULL on failure. ! static const wxLuaBindClass* GetBindClass(int wxl_type, const wxLuaBindingList* bindingList); // Get the first wxLuaBindClass that has this particular wxLuaBindMethod // returns NULL on failure. ! static const wxLuaBindClass* GetBindClass(const wxLuaBindMethod* wxlMethod, const wxLuaBindingList* bindingList); // Get the first wxLuaBindClass that has this particular wxLuaBindCFunc in its methods // returns NULL on failure. ! static const wxLuaBindClass* GetBindClass(const wxLuaBindCFunc* wxlCFunc, const wxLuaBindingList* bindingList); // Get wxLuaBindEvent for given wxEventType (wxEvent::GetEventType()) by finding // the matching wxLuaBindEvent::eventType. // returns NULL on failure. ! static const wxLuaBindEvent* GetBindEvent(wxEventType eventType, const wxLuaBindingList* bindingList); // Get the wxLuaBinding that has this wxLuaBindMethod in its wxLuaBinding::GetFunctionArray(). // returns NULL on failure. ! static wxLuaBinding* GetFunctionBinding(const wxLuaBindMethod* wxlMethod, const wxLuaBindingList* bindingList); // ----------------------------------------------------------------------- --- 546,574 ---- // ----------------------------------------------------------------------- ! // These functions search through the static wxLuaBinding::GetBindingList() ! // for the items. // Get the installed wxLuaBinding with the given // wxLuaBinding::GetBindingName() or NULL for no match. ! static wxLuaBinding* GetLuaBinding(const wxString& bindingName); // Get wxLuaBindClass for given wxLua type using wxLuaBindClass::wxluatype, // returns NULL on failure. ! static const wxLuaBindClass* FindBindClass(int wxl_type); // Get the first wxLuaBindClass that has this particular wxLuaBindMethod // returns NULL on failure. ! static const wxLuaBindClass* FindBindClass(const wxLuaBindMethod* wxlMethod); // Get the first wxLuaBindClass that has this particular wxLuaBindCFunc in its methods // returns NULL on failure. ! static const wxLuaBindClass* FindBindClass(const wxLuaBindCFunc* wxlCFunc); // Get wxLuaBindEvent for given wxEventType (wxEvent::GetEventType()) by finding // the matching wxLuaBindEvent::eventType. // returns NULL on failure. ! static const wxLuaBindEvent* FindBindEvent(wxEventType eventType); // Get the wxLuaBinding that has this wxLuaBindMethod in its wxLuaBinding::GetFunctionArray(). // returns NULL on failure. ! static wxLuaBinding* FindMethodBinding(const wxLuaBindMethod* wxlMethod); // ----------------------------------------------------------------------- *************** *** 628,639 **** wxString m_bindingName; // A unique name of the binding wxString m_nameSpace; // Lua table namespace e.g. "wx" ! bool m_bindings_registered; // Is the binding registered ! int m_first_wxluatype; // The first wxLua type allocated for a class ! int m_last_wxluatype; // The last wxLua type of registered classes ! int m_luaTable_ref; // The Lua ref for the wxLua private tables static wxLuaBindingList sm_bindingList; static bool sm_bindingList_initialized; ! static int sm_wxluatype_counter; DECLARE_ABSTRACT_CLASS(wxLuaBinding) --- 628,637 ---- wxString m_bindingName; // A unique name of the binding wxString m_nameSpace; // Lua table namespace e.g. "wx" ! int m_first_wxluatype; // The first wxLua type allocated for a class ! int m_last_wxluatype; // The last wxLua type of registered classes static wxLuaBindingList sm_bindingList; static bool sm_bindingList_initialized; ! static int sm_wxluatype_max; DECLARE_ABSTRACT_CLASS(wxLuaBinding) Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** wxlstate.h 23 Jan 2008 06:43:38 -0000 1.117 --- wxlstate.h 24 Jan 2008 00:18:17 -0000 1.118 *************** *** 19,26 **** class WXDLLIMPEXP_WXLUA wxLuaEvent; class WXDLLIMPEXP_WXLUA wxLuaState; class WXDLLIMPEXP_WXLUA wxLuaStateRefData; class WXDLLIMPEXP_WXLUA wxLuaEventCallback; class WXDLLIMPEXP_WXLUA wxLuaWinDestroyCallback; - class WXDLLIMPEXP_WXLUA wxLuaDebugHookData; // ---------------------------------------------------------------------------- --- 19,26 ---- class WXDLLIMPEXP_WXLUA wxLuaEvent; class WXDLLIMPEXP_WXLUA wxLuaState; + class WXDLLIMPEXP_WXLUA wxLuaStateData; class WXDLLIMPEXP_WXLUA wxLuaStateRefData; class WXDLLIMPEXP_WXLUA wxLuaEventCallback; class WXDLLIMPEXP_WXLUA wxLuaWinDestroyCallback; // ---------------------------------------------------------------------------- *************** *** 85,89 **** // Note: The wxLua types WXLUA_TXXX that correspond to the Lua LUA_TXXX types // are not stored in this table since they do not use our metatables. ! // The keys in this table are all > 1. // LUA_REGISTRYINDEX[&wxlua_lreg_types_key][wxLua type number] = { metatable for a C++ class } extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_types_key; --- 85,90 ---- // Note: The wxLua types WXLUA_TXXX that correspond to the Lua LUA_TXXX types // are not stored in this table since they do not use our metatables. ! // The keys in this table are all > 1. They values are either tables or 0 ! // if the wxLuaBinding containing the wxLua type was not registered. // LUA_REGISTRYINDEX[&wxlua_lreg_types_key][wxLua type number] = { metatable for a C++ class } extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_types_key; *************** *** 94,99 **** extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_refs_key; // The key in the LUA_REGISTRYINDEX table that is a numerically keyed table ! // with references to objects the wxLuaDebugData wants to keep a handle to and ! // stores their value for lookup. It is used only for the wxLuaDebugData. // LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][ref number] = Lua object extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_debug_refs_key; --- 95,100 ---- extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_refs_key; // The key in the LUA_REGISTRYINDEX table that is a numerically keyed table ! // with references to objects the wxLuaDebugData wants to keep a handle to by ! // storing their value for lookup. It is used only for the wxLuaDebugData. // LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][ref number] = Lua object extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_debug_refs_key; *************** *** 111,114 **** --- 112,119 ---- // LUA_REGISTRYINDEX[&wxlua_lreg_wxluastate_key] = lightuserdata(&wxLuaState) extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluastate_key; + // The key in the LUA_REGISTRYINDEX table that is a table of lightuserdata + // wxLuaBindings and the ref to the Lua table they were installed into. + // LUA_REGISTRYINDEX[&wxlua_lreg_wxluabindings_key] = {lightuserdata(&wxLuaBinding) = wxlua_lreg_refs_key ref#, ...} + extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluabindings_key; // The key in the LUA_REGISTRYINDEX table that is a table of all // objects that we've pushed into Lua using wxluaT_pushuserdatatype(). *************** *** 149,156 **** // LUA_REGISTRYINDEX[&wxlua_lreg_wxeventtype_key] = wxEventType (wxEVT_NULL) extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxeventtype_key; ! // The key in the LUA_REGISTRYINDEX table that has a wxLuaDebugHookData // lightuserdata value for the wxLuaState. ! // LUA_REGISTRYINDEX[&wxlua_lreg_wxluadebughookdata_key] = lightuserdata(&wxLuaDebugHookData) ! extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluadebughookdata_key; // The key in the LUA_REGISTRYINDEX table that is a weak keyed table of // the tables wxLua pushed into the registry with their keys as values. --- 154,161 ---- // LUA_REGISTRYINDEX[&wxlua_lreg_wxeventtype_key] = wxEventType (wxEVT_NULL) extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxeventtype_key; ! // The key in the LUA_REGISTRYINDEX table that has a wxLuaStateData class // lightuserdata value for the wxLuaState. ! // LUA_REGISTRYINDEX[&wxlua_lreg_wxluastatedata_key] = lightuserdata(&wxLuaStateData) ! extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluastatedata_key; // The key in the LUA_REGISTRYINDEX table that is a weak keyed table of // the tables wxLua pushed into the registry with their keys as values. *************** *** 199,206 **** // Get information from the return value of lua_pcall(), luaL_loadbuffer(), etc ! // and builds an errMsg with wxlua_LUA_ERR_msg() and if the current top // is > than top it tries to get Lua's error string from the top of the stack. ! // Returns true if status != 0 and the errMsg and line_num are filled. ! // If errMsg and line_num aren't null then fill them with the msg and line. // status is the return from lua_pcall(), luaL_loadbuffer(), etc, LUA_ERRxxx // top is the lua_gettop from before the call that may have generated the error. --- 204,211 ---- // Get information from the return value of lua_pcall(), luaL_loadbuffer(), etc ! // The errMsg input is filled with wxlua_LUA_ERR_msg() and if the current top // is > than top it tries to get Lua's error string from the top of the stack. ! // Returns true if the input status != 0 and the errMsg and line_num are filled. ! // If errMsg and line_num aren't NULL then fill them with the msg and line. // status is the return from lua_pcall(), luaL_loadbuffer(), etc, LUA_ERRxxx // top is the lua_gettop from before the call that may have generated the error. *************** *** 346,350 **** // Allocate a new table (a metatable for a userdata) with a ! // wxlua_metatable_type_key key equal to the number from wxluaR_ref() and // store it in the wxlua_lreg_types_key LUA_REGISTRYINDEX table. // Returns the index into the wxLua types table which is a new wxLua type. --- 351,355 ---- // Allocate a new table (a metatable for a userdata) with a ! // wxlua_metatable_type_key key equal to the input wxl_type and // store it in the wxlua_lreg_types_key LUA_REGISTRYINDEX table. // Returns the index into the wxLua types table which is a new wxLua type. *************** *** 515,519 **** ! // Push the program args into a global table called "args" as the lua executable does. // start_n is the arg to start pushing until max args "argc". // returns the number of args pushed. --- 520,524 ---- ! // Push the program args into a global table called "args" as the Lua executable does. // start_n is the arg to start pushing until max args "argc". // returns the number of args pushed. *************** *** 564,594 **** WXDLLIMPEXP_WXLUA void LUACALL wxlua_setwxeventtype(lua_State* L, wxEventType evt_type); ! // Get the wxlua_lreg_wxluadebughookdata_key wxLuaDebugHookData value from // the LUA_REGISTRYINDEX table for the owner wxLuaState. // Note: It returns NULL if the lua_State is about to be closed. ! WXDLLIMPEXP_WXLUA wxLuaDebugHookData* LUACALL wxlua_getwxluadebughookdata(lua_State* L); ! ! //---------------------------------------------------------------------------- ! // wxLuaDebugHookData - data for setting/getting the debug hook settings ! //---------------------------------------------------------------------------- ! ! class WXDLLIMPEXP_WXLUA wxLuaDebugHookData ! { ! public: ! wxLuaDebugHookData() : m_lua_debug_hook_count(100), m_lua_debug_hook_yield(50), ! m_lua_debug_hook(0), m_lua_debug_hook_send_evt(false), ! m_last_debug_hook_time(0), m_debug_hook_break(false), ! m_debug_hook_break_msg(wxT("Break")) {} ! ! int m_lua_debug_hook_count; // values from wxLuaState::SetLuaDebugHook() ! int m_lua_debug_hook_yield; ! int m_lua_debug_hook; ! bool m_lua_debug_hook_send_evt; ! ! unsigned long m_last_debug_hook_time; // last time the debug hook was called ! ! bool m_debug_hook_break; // should the lua_State break for next debug_hook ! wxString m_debug_hook_break_msg; // message when breaking in the debug_hook ! }; //---------------------------------------------------------------------------- --- 569,576 ---- WXDLLIMPEXP_WXLUA void LUACALL wxlua_setwxeventtype(lua_State* L, wxEventType evt_type); ! // Get the wxlua_lreg_wxluastatedata_key wxLuaStateData value from // the LUA_REGISTRYINDEX table for the owner wxLuaState. // Note: It returns NULL if the lua_State is about to be closed. ! WXDLLIMPEXP_WXLUA wxLuaStateData* LUACALL wxlua_getwxluastatedata(lua_State* L); //---------------------------------------------------------------------------- *************** *** 605,616 **** ~wxLuaStateData(); - wxLuaBindingList m_bindingList; // A wxList of generated Lua bindings - // that are loaded into Lua on startup - bool m_bindings_registered; // Are the bindings registered into the lua_State - bool m_is_running; // is the lua_State running a script bool m_is_closing; // are we currently being closed ! wxLuaDebugHookData m_debugHookData; // Data for the wxLuaState::SetLuaDebugHook() wxEvtHandler *m_evtHandler; // event handler to send wxLuaEvents to --- 587,602 ---- ~wxLuaStateData(); bool m_is_running; // is the lua_State running a script bool m_is_closing; // are we currently being closed ! int m_lua_debug_hook_count; // values from wxLuaState::SetLuaDebugHook() ! int m_lua_debug_hook_yield; ! int m_lua_debug_hook; ! bool m_lua_debug_hook_send_evt; ! ! unsigned long m_last_debug_hook_time; // last time the debug hook was called ! ! bool m_debug_hook_break; // should the lua_State break for next debug_hook ! wxString m_debug_hook_break_msg; // message when breaking in the debug_hook wxEvtHandler *m_evtHandler; // event handler to send wxLuaEvents to *************** *** 644,649 **** bool m_lua_State_coroutine; // this is a coroutine, don't close it ! wxLuaStateData* m_wxlStateData; // the data shared for this state ! bool m_own_stateData; // not a coroutine when true, so delete it when done }; --- 630,635 ---- bool m_lua_State_coroutine; // this is a coroutine, don't close it ! wxLuaStateData* m_wxlStateData; // the data shared for this state ! bool m_own_stateData; // not a coroutine when true, so delete it when done }; *************** *** 668,672 **** wxLUASTATE_OPENBINDINGS = 0x20, // Install all the bindings in // wxLuaBinding::GetBindingList() into the ! // lua_State. }; --- 654,660 ---- wxLUASTATE_OPENBINDINGS = 0x20, // Install all the bindings in // wxLuaBinding::GetBindingList() into the ! // lua_State. You may install the bindings ! // one at a time using ! // wxLuaState::RegisterBinding(wxLuaBinding*) }; *************** *** 875,881 **** void RegisterFunction(lua_CFunction func, const char* funcName); wxLUA_UNICODE_ONLY(void RegisterFunction(lua_CFunction func, const wxString &funcName) { RegisterFunction(func, wx2lua(funcName)); }) ! // Register all the bindings in the wxLuaStateData, this is done ! // automatically by default on creation. (internal use) ! void RegisterBindings(); // Get the installed wxLuaBinding with the given --- 863,872 ---- void RegisterFunction(lua_CFunction func, const char* funcName); wxLUA_UNICODE_ONLY(void RegisterFunction(lua_CFunction func, const wxString &funcName) { RegisterFunction(func, wx2lua(funcName)); }) ! ! // Register a single wxLuaBinding. ! bool RegisterBinding(wxLuaBinding* binding); ! // Register all the bindings in the wxLuaBinding::GetBindingList(), this is done ! // automatically if the wxLuaState is created with wxLUASTATE_OPENBINDINGS. ! bool RegisterBindings(); // Get the installed wxLuaBinding with the given *************** *** 903,914 **** const wxLuaBindEvent* GetBindEvent(wxEventType eventType) const; - // Get the wxLuaBinding list of classes/objects installed into Lua. - // You may add or remove bindings before the creation of any wxLuaStates - // or once they have all been Destroy()ed. However, while any wxLuaStates - // are created they must have the same bindings in the same order! - wxLuaBindingList* GetLuaBindingList() const; - - bool GetBindingsRegistered() const; // Are the binding registered - // See wxlua_setcallbaseclassfunction() and wxlua_getcallbaseclassfunction(). void SetCallBaseClassFunction(bool call_base); --- 894,897 ---- Index: wxlua_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlua_bind.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wxlua_bind.h 23 Jan 2008 06:43:38 -0000 1.11 --- wxlua_bind.h 24 Jan 2008 00:18:17 -0000 1.12 *************** *** 17,23 **** // 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 // --------------------------------------------------------------------------- --- 17,23 ---- // 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 // --------------------------------------------------------------------------- *************** *** 37,42 **** - // bind wxLuaBinding_wxlua to a single wxLuaState - extern WXDLLIMPEXP_WXLUA bool wxLuaBinding_wxlua_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxlua for all wxLuaStates extern WXDLLIMPEXP_WXLUA bool wxLuaBinding_wxlua_init(); --- 37,40 ---- |
From: John L. <jr...@us...> - 2008-01-24 00:18:24
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/modules/wxluadebug/src Modified Files: wxldebug.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: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** wxldebug.cpp 4 Jan 2008 00:21:08 -0000 1.64 --- wxldebug.cpp 24 Jan 2008 00:18:18 -0000 1.65 *************** *** 367,370 **** --- 367,376 ---- value += wxLuaBindClassString(wxlClass); } + else if (lightuserdata_reg_key == &wxlua_lreg_wxluabindings_key) + { + wxLuaBinding* binding = (wxLuaBinding*)lua_touserdata(L, -2); + name = wxT("wxLuaBinding(")+name+wxT(") -> ")+binding->GetBindingName(); + value += wxT(" = ") + binding->GetLuaNamespace(); + } else if (lightuserdata_reg_key == &wxlua_lreg_evtcallbacks_key) { *************** *** 618,621 **** --- 624,628 ---- (udata == &wxlua_lreg_derivedmethods_key) || (udata == &wxlua_lreg_wxluastate_key) || + (udata == &wxlua_lreg_wxluabindings_key) || (udata == &wxlua_lreg_weakobjects_key) || (udata == &wxlua_lreg_gcobjects_key) || *************** *** 624,628 **** (udata == &wxlua_lreg_callbaseclassfunc_key) || (udata == &wxlua_lreg_wxeventtype_key) || ! (udata == &wxlua_lreg_wxluadebughookdata_key) || (udata == &wxlua_lreg_regtable_key) || --- 631,635 ---- (udata == &wxlua_lreg_callbaseclassfunc_key) || (udata == &wxlua_lreg_wxeventtype_key) || ! (udata == &wxlua_lreg_wxluastatedata_key) || (udata == &wxlua_lreg_regtable_key) || |
From: John L. <jr...@us...> - 2008-01-24 00:18:23
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/samples Modified Files: controls.wx.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: controls.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/controls.wx.lua,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** controls.wx.lua 23 Jan 2008 06:43:40 -0000 1.17 --- controls.wx.lua 24 Jan 2008 00:18:19 -0000 1.18 *************** *** 284,288 **** elseif typ == wxlua.WXLUA_TTABLE then s = s.."("..table.concat(v, ",")..")" ! elseif typ <= wxlua.WXLUA_TCFUNCTION then -- the rest of generic lua types s = s..tostring(v) elseif typ_name == "wxPoint" then --- 284,288 ---- elseif typ == wxlua.WXLUA_TTABLE then s = s.."("..table.concat(v, ",")..")" ! elseif typ <= wxlua.WXLUA_T_MAX then -- the rest of generic lua types s = s..tostring(v) elseif typ_name == "wxPoint" then |
From: John L. <jr...@us...> - 2008-01-24 00:18:23
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlstate.cpp wxlua_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: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.165 retrieving revision 1.166 diff -C2 -d -r1.165 -r1.166 *** wxlstate.cpp 23 Jan 2008 06:43:39 -0000 1.165 --- wxlstate.cpp 24 Jan 2008 00:18:18 -0000 1.166 *************** *** 32,35 **** --- 32,36 ---- 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"; *************** *** 39,43 **** const char* wxlua_lreg_callbaseclassfunc_key = "wxLua CallBaseClassFunc"; const char* wxlua_lreg_wxeventtype_key = "wxLua wxEventType"; ! const char* wxlua_lreg_wxluadebughookdata_key = "wxLuaDebugHookData"; const char* wxlua_lreg_regtable_key = "wxLua LUA_REGISTRYINDEX tables"; --- 40,44 ---- 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"; *************** *** 99,104 **** { // NULL when shutting down. ! wxLuaDebugHookData* hookData = wxlua_getwxluadebughookdata(L); ! if (!hookData) return; // FIXME - for select event types we don't want to do anything --- 100,105 ---- { // NULL when shutting down. ! wxLuaStateData* wxlStateData = wxlua_getwxluastatedata(L); ! if (!wxlStateData) return; // FIXME - for select event types we don't want to do anything *************** *** 110,114 **** // they want to break the program, restore old debug hook, then error out ! if (hookData->m_debug_hook_break) { // It's ok that we get the wxLuaState here since we're stopping anyway. --- 111,115 ---- // they want to break the program, restore old debug hook, then error out ! if (wxlStateData->m_debug_hook_break) { // It's ok that we get the wxLuaState here since we're stopping anyway. *************** *** 117,121 **** // restore hook to previous state wxlState.ClearDebugHookBreak(); ! wxlua_error(L, hookData->m_debug_hook_break_msg); return; } --- 118,122 ---- // restore hook to previous state wxlState.ClearDebugHookBreak(); ! wxlua_error(L, wxlStateData->m_debug_hook_break_msg); return; } *************** *** 123,127 **** // Assume they've set the wxEvtHandler, ok if not, but it wouldn't make sense // We use wxLuaState::SendEvent() because it sets wxEvent::SetEventObject() for us. ! if (hookData->m_lua_debug_hook_send_evt) { wxLuaState wxlState(L); --- 124,128 ---- // Assume they've set the wxEvtHandler, ok if not, but it wouldn't make sense // We use wxLuaState::SendEvent() because it sets wxEvent::SetEventObject() for us. ! if (wxlStateData->m_lua_debug_hook_send_evt) { wxLuaState wxlState(L); *************** *** 139,152 **** // Try to yield *after* sending event to allow C++ gui update ! if (hookData->m_lua_debug_hook_yield > 0) { // yield based on number of ms passed NOT every hook event ! unsigned long last_time = hookData->m_last_debug_hook_time; unsigned long cur_time = wxGetLocalTimeMillis().GetLo(); ! if ((cur_time > last_time + hookData->m_lua_debug_hook_yield) || (cur_time < last_time)) // wrapped { ! hookData->m_last_debug_hook_time = cur_time; bool painting = (evtType == wxEVT_PAINT); --- 140,153 ---- // Try to yield *after* sending event to allow C++ gui update ! if (wxlStateData->m_lua_debug_hook_yield > 0) { // yield based on number of ms passed NOT every hook event ! unsigned long last_time = wxlStateData->m_last_debug_hook_time; unsigned long cur_time = wxGetLocalTimeMillis().GetLo(); ! if ((cur_time > last_time + wxlStateData->m_lua_debug_hook_yield) || (cur_time < last_time)) // wrapped { ! wxlStateData->m_last_debug_hook_time = cur_time; bool painting = (evtType == wxEVT_PAINT); *************** *** 308,317 **** // check if this method is part of a class ! const wxLuaBindClass* wxlClass = wxLuaBinding::GetBindClass(wxlMethod, NULL); // if not, check if it's a global C style function wxLuaBinding* binding = NULL; if (wxlClass == NULL) ! binding = wxLuaBinding::GetFunctionBinding(wxlMethod, NULL); if ((wxlClass != NULL) || (binding != NULL)) --- 309,318 ---- // check if this method is part of a class ! const wxLuaBindClass* wxlClass = wxLuaBinding::FindBindClass(wxlMethod); // if not, check if it's a global C style function wxLuaBinding* binding = NULL; if (wxlClass == NULL) ! binding = wxLuaBinding::FindMethodBinding(wxlMethod); if ((wxlClass != NULL) || (binding != NULL)) *************** *** 1869,1878 **** } ! wxLuaDebugHookData* LUACALL wxlua_getwxluadebughookdata(lua_State* L) { ! lua_pushlightuserdata(L, &wxlua_lreg_wxluadebughookdata_key); lua_rawget( L, LUA_REGISTRYINDEX ); // pop key, push bool ! wxLuaDebugHookData* data = (wxLuaDebugHookData*)lua_touserdata(L, -1); lua_pop(L, 1); // pop udata --- 1870,1879 ---- } ! wxLuaStateData* LUACALL wxlua_getwxluastatedata(lua_State* L) { ! lua_pushlightuserdata(L, &wxlua_lreg_wxluastatedata_key); lua_rawget( L, LUA_REGISTRYINDEX ); // pop key, push bool ! wxLuaStateData* data = (wxLuaStateData*)lua_touserdata(L, -1); lua_pop(L, 1); // pop udata *************** *** 2026,2045 **** wxLuaStateData::wxLuaStateData() ! :m_bindings_registered(false), ! m_is_running(false), m_is_closing(false), m_evtHandler(NULL), m_id(wxID_ANY) { - // we add "new" copies of the bindings, let the list delete them - m_bindingList.DeleteContents(true); - - wxLuaBindingList::compatibility_iterator node = wxLuaBinding::GetBindingList()->GetFirst(); - while (node) - { - wxLuaBinding* binding = node->GetData(); - m_bindingList.Append(binding->Clone()); // append the "new" binding - node = node->GetNext(); - } } --- 2027,2039 ---- wxLuaStateData::wxLuaStateData() ! :m_is_running(false), m_is_closing(false), + m_lua_debug_hook_count(100), m_lua_debug_hook_yield(50), + m_lua_debug_hook(0), m_lua_debug_hook_send_evt(false), + m_last_debug_hook_time(0), m_debug_hook_break(false), + m_debug_hook_break_msg(wxT("Break")), m_evtHandler(NULL), m_id(wxID_ANY) { } *************** *** 2048,2059 **** // no events here, the handler may already be gone m_evtHandler = NULL; - - wxLuaBindingList::compatibility_iterator node = m_bindingList.GetFirst(); - while (node) - { - wxLuaBindingList::compatibility_iterator next_node = node->GetNext(); - m_bindingList.DeleteNode(node); // see m_bindingList.DeleteContents(true) - node = next_node; - } } --- 2042,2045 ---- *************** *** 2138,2144 **** } ! // clear the wxlua_lreg_wxluadebughookdata_key which we test for in the debug hook // to know if the lua_State is being closed ! lua_pushlightuserdata(m_lua_State, &wxlua_lreg_wxluadebughookdata_key); lua_pushnil(m_lua_State); lua_rawset( m_lua_State, LUA_REGISTRYINDEX ); // pop key, push bool --- 2124,2130 ---- } ! // clear the wxlua_lreg_wxluastatedata_key which we test for in the debug hook // to know if the lua_State is being closed ! lua_pushlightuserdata(m_lua_State, &wxlua_lreg_wxluastatedata_key); lua_pushnil(m_lua_State); lua_rawset( m_lua_State, LUA_REGISTRYINDEX ); // pop key, push bool *************** *** 2328,2334 **** wxlua_setwxeventtype(L, wxEVT_NULL); ! // Push our debug hook data ! lua_pushlightuserdata(L, &wxlua_lreg_wxluadebughookdata_key); ! lua_pushlightuserdata(L, &M_WXLSTATEDATA->m_wxlStateData->m_debugHookData); lua_rawset(L, LUA_REGISTRYINDEX); // set the value --- 2314,2320 ---- wxlua_setwxeventtype(L, wxEVT_NULL); ! // Push our wxLuaStateData ! lua_pushlightuserdata(L, &wxlua_lreg_wxluastatedata_key); ! lua_pushlightuserdata(L, M_WXLSTATEDATA->m_wxlStateData); lua_rawset(L, LUA_REGISTRYINDEX); // set the value *************** *** 2361,2364 **** --- 2347,2353 ---- wxlua_lreg_createtable(L, &wxlua_lreg_derivedmethods_key); + // Create a table for the wxLuaBindings we've installed + wxlua_lreg_createtable(L, &wxlua_lreg_wxluabindings_key); + // Create a table for the userdata that we've pushed into Lua wxlua_lreg_createtable(L, &wxlua_lreg_weakobjects_key); *************** *** 2543,2547 **** wxCHECK_MSG(!M_WXLSTATEDATA->m_wxlStateData->m_is_running, LUA_ERRRUN, wxT("Lua interpreter is already running")); ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break = false; M_WXLSTATEDATA->m_wxlStateData->m_is_running = true; --- 2532,2536 ---- wxCHECK_MSG(!M_WXLSTATEDATA->m_wxlStateData->m_is_running, LUA_ERRRUN, wxT("Lua interpreter is already running")); ! M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break = false; M_WXLSTATEDATA->m_wxlStateData->m_is_running = true; *************** *** 2555,2559 **** lua_SetTop(top); // restore original top (removes err msg) ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break = false; M_WXLSTATEDATA->m_wxlStateData->m_is_running = false; --- 2544,2548 ---- lua_SetTop(top); // restore original top (removes err msg) ! M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break = false; M_WXLSTATEDATA->m_wxlStateData->m_is_running = false; *************** *** 2572,2576 **** wxCHECK_MSG(!M_WXLSTATEDATA->m_wxlStateData->m_is_running, LUA_ERRRUN, wxT("Lua interpreter is already running")); ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break = false; M_WXLSTATEDATA->m_wxlStateData->m_is_running = true; --- 2561,2565 ---- wxCHECK_MSG(!M_WXLSTATEDATA->m_wxlStateData->m_is_running, LUA_ERRRUN, wxT("Lua interpreter is already running")); ! M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break = false; M_WXLSTATEDATA->m_wxlStateData->m_is_running = true; *************** *** 2584,2588 **** lua_SetTop(top); // restore original top (removes err msg) ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break = false; M_WXLSTATEDATA->m_wxlStateData->m_is_running = false; --- 2573,2577 ---- lua_SetTop(top); // restore original top (removes err msg) ! M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break = false; M_WXLSTATEDATA->m_wxlStateData->m_is_running = false; *************** *** 2690,2695 **** // recursion asserts if you call wxlua_Error() within another wxYield, i.e. from a gui button ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break_msg = msg; ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break = true; lua_sethook(GetLuaState(), wxlua_debugHookFunction, LUA_MASKCALL|LUA_MASKRET|LUA_MASKLINE|LUA_MASKCOUNT, 1); M_WXLSTATEDATA->m_wxlStateData->m_is_running = false; --- 2679,2684 ---- // recursion asserts if you call wxlua_Error() within another wxYield, i.e. from a gui button ! M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break_msg = msg; ! M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break = true; lua_sethook(GetLuaState(), wxlua_debugHookFunction, LUA_MASKCALL|LUA_MASKRET|LUA_MASKLINE|LUA_MASKCOUNT, 1); M_WXLSTATEDATA->m_wxlStateData->m_is_running = false; *************** *** 2700,2704 **** wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break = false; SetLuaDebugHook(GetLuaDebugHookCount(), GetLuaDebugHookYield(), --- 2689,2693 ---- wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break = false; SetLuaDebugHook(GetLuaDebugHookCount(), GetLuaDebugHookYield(), *************** *** 2710,2719 **** { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break; } wxString wxLuaState::GetDebugHookBreakMessage() const { wxCHECK_MSG(Ok(), wxEmptyString, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_debug_hook_break_msg; } --- 2699,2708 ---- { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break; } wxString wxLuaState::GetDebugHookBreakMessage() const { wxCHECK_MSG(Ok(), wxEmptyString, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debug_hook_break_msg; } *************** *** 2724,2731 **** wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_lua_debug_hook = hook; ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_lua_debug_hook_count = count; ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_lua_debug_hook_yield = yield_ms; ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_lua_debug_hook_send_evt = send_debug_evt; // These are the various hooks you can install --- 2713,2720 ---- wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_lua_debug_hook = hook; ! M_WXLSTATEDATA->m_wxlStateData->m_lua_debug_hook_count = count; ! M_WXLSTATEDATA->m_wxlStateData->m_lua_debug_hook_yield = yield_ms; ! M_WXLSTATEDATA->m_wxlStateData->m_lua_debug_hook_send_evt = send_debug_evt; // These are the various hooks you can install *************** *** 2737,2756 **** { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_lua_debug_hook; } int wxLuaState::GetLuaDebugHookCount() const { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_lua_debug_hook_count; } int wxLuaState::GetLuaDebugHookYield() const { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_lua_debug_hook_yield; } bool wxLuaState::GetLuaDebugHookSendEvt() const { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_lua_debug_hook_send_evt; } --- 2726,2745 ---- { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_lua_debug_hook; } int wxLuaState::GetLuaDebugHookCount() const { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_lua_debug_hook_count; } int wxLuaState::GetLuaDebugHookYield() const { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_lua_debug_hook_yield; } bool wxLuaState::GetLuaDebugHookSendEvt() const { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_lua_debug_hook_send_evt; } *************** *** 2758,2767 **** { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_last_debug_hook_time; } void wxLuaState::SetLastLuaDebugHookTime(unsigned long t) { wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_debugHookData.m_last_debug_hook_time = t; } --- 2747,2756 ---- { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_last_debug_hook_time; } void wxLuaState::SetLastLuaDebugHookTime(unsigned long t) { wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_last_debug_hook_time = t; } *************** *** 2774,2788 **** } ! void wxLuaState::RegisterBindings() { ! wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! // Note: It may be possible to allow this in the future if there is a need. ! wxCHECK_RET(!GetBindingsRegistered(), wxT("wxLua bindings already registered")); wxLuaBinding::InitAllBindings(); // only runs the first time through // Register bindings ! wxLuaBindingList::compatibility_iterator node = M_WXLSTATEDATA->m_wxlStateData->m_bindingList.GetFirst(); while (node) { --- 2763,2785 ---- } ! bool wxLuaState::RegisterBinding(wxLuaBinding* binding) { ! wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! wxCHECK_MSG(binding, false, wxT("Invalid wxLuaState")); ! wxLuaBinding::InitAllBindings(); // only runs the first time through ! ! binding->RegisterBinding(*this); + return true; + } + + bool wxLuaState::RegisterBindings() + { + wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); wxLuaBinding::InitAllBindings(); // only runs the first time through // Register bindings ! wxLuaBindingList::compatibility_iterator node = wxLuaBinding::GetBindingList()->GetFirst(); while (node) { *************** *** 2792,2796 **** } ! M_WXLSTATEDATA->m_wxlStateData->m_bindings_registered = true; } --- 2789,2793 ---- } ! return true; } *************** *** 2798,2802 **** { wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); ! return wxLuaBinding::GetLuaBinding(bindingName, &M_WXLSTATEDATA->m_wxlStateData->m_bindingList); } --- 2795,2799 ---- { wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); ! return wxLuaBinding::GetLuaBinding(bindingName); } *************** *** 2810,2814 **** // we shouldn't ever need this code if (wxlClass == NULL) ! wxlClass = wxLuaBinding::GetBindClass(wxluatype, &M_WXLSTATEDATA->m_wxlStateData->m_bindingList); return wxlClass; --- 2807,2811 ---- // we shouldn't ever need this code if (wxlClass == NULL) ! wxlClass = wxLuaBinding::FindBindClass(wxluatype); return wxlClass; *************** *** 2822,2831 **** { wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); ! return wxLuaBinding::GetBindClass(wxlMethod, &M_WXLSTATEDATA->m_wxlStateData->m_bindingList); } const wxLuaBindClass* wxLuaState::GetBindClass(const wxLuaBindCFunc* wxlClass) const { wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); ! return wxLuaBinding::GetBindClass(wxlClass, &M_WXLSTATEDATA->m_wxlStateData->m_bindingList); } --- 2819,2828 ---- { wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); ! return wxLuaBinding::FindBindClass(wxlMethod); } const wxLuaBindClass* wxLuaState::GetBindClass(const wxLuaBindCFunc* wxlClass) const { wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); ! return wxLuaBinding::FindBindClass(wxlClass); } *************** *** 2839,2854 **** { wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return wxLuaBinding::GetBindEvent(eventType, &M_WXLSTATEDATA->m_wxlStateData->m_bindingList); ! } ! ! wxLuaBindingList* wxLuaState::GetLuaBindingList() const ! { ! wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); ! return &M_WXLSTATEDATA->m_wxlStateData->m_bindingList; ! } ! bool wxLuaState::GetBindingsRegistered() const ! { ! wxCHECK_MSG(GetRefData() != NULL, false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_bindings_registered; } --- 2836,2840 ---- { wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return wxLuaBinding::FindBindEvent(eventType); } Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** wxlbind.cpp 23 Jan 2008 06:43:39 -0000 1.117 --- wxlbind.cpp 24 Jan 2008 00:18:17 -0000 1.118 *************** *** 815,819 **** wxString className; ! const wxLuaBindClass* wxlClass = wxLuaBinding::GetBindClass(method, NULL); if (wxlClass) className = lua2wx(wxlClass->name) + wxT("::"); --- 815,819 ---- wxString className; ! const wxLuaBindClass* wxlClass = wxLuaBinding::FindBindClass(method); if (wxlClass) className = lua2wx(wxlClass->name) + wxT("::"); *************** *** 942,946 **** wxLuaBindingList wxLuaBinding::sm_bindingList; bool wxLuaBinding::sm_bindingList_initialized = false; ! int wxLuaBinding::sm_wxluatype_counter = WXLUA_T_MAX+1; wxLuaBinding::wxLuaBinding() --- 942,946 ---- wxLuaBindingList wxLuaBinding::sm_bindingList; bool wxLuaBinding::sm_bindingList_initialized = false; ! int wxLuaBinding::sm_wxluatype_max = WXLUA_T_MAX; wxLuaBinding::wxLuaBinding() *************** *** 951,958 **** m_objectCount(0), m_objectArray(NULL), m_functionCount(0), m_functionArray(NULL), ! m_bindings_registered(false), ! m_first_wxluatype(0), ! m_last_wxluatype(0), ! m_luaTable_ref(-1) { } --- 951,956 ---- m_objectCount(0), m_objectArray(NULL), m_functionCount(0), m_functionArray(NULL), ! m_first_wxluatype(WXLUA_TUNKNOWN), ! m_last_wxluatype(WXLUA_TUNKNOWN) { } *************** *** 964,967 **** --- 962,969 ---- if (m_classArray && (m_classCount > 0)) { + // initialize types only once, we don't need to resort them either + if (*m_classArray[0].wxluatype != WXLUA_TUNKNOWN) + return; + qsort(m_classArray, m_classCount, sizeof(wxLuaBindClass), wxLuaBindClassArrayCompareFn); *************** *** 969,975 **** for (size_t i = 0; i < m_classCount; ++i, ++wxlClass) { ! // initialize types only once ! if (*wxlClass->wxluatype == WXLUA_TUNKNOWN) ! *wxlClass->wxluatype = wxLuaBinding::sm_wxluatype_counter++; // Also sort the member functions for each class --- 971,975 ---- for (size_t i = 0; i < m_classCount; ++i, ++wxlClass) { ! *wxlClass->wxluatype = ++wxLuaBinding::sm_wxluatype_max; // Also sort the member functions for each class *************** *** 980,983 **** --- 980,987 ---- qsort(wxlClass->enums, wxlClass->enums_n, sizeof(wxLuaBindNumber), wxLuaBindNumberArrayCompareFn); } + + // these mark what types numbers are declared in this binding + m_first_wxluatype = *m_classArray[0].wxluatype; + m_last_wxluatype = *m_classArray[m_classCount-1].wxluatype; } *************** *** 1001,1014 **** lua_State *L = wxlState.GetLuaState(); - if (m_bindings_registered) - { - wxString s; - s.Printf(wxT("wxLua: Bindings '%s' in Lua namespace '%s' are already registered."), - m_bindingName.c_str(), m_nameSpace.c_str()); - - wxlua_error(L, s); - return false; - } - // Let Lua create a new table for us and add it to these places. // We use an empty luaL_Reg since we just want luaI_openlib to create the --- 1005,1008 ---- *************** *** 1034,1059 **** // Find a registered binding with the same namespace, if any, ! // and share the m_luaTable_ref to that of the previously loaded binding ! wxLuaBindingList::compatibility_iterator node = wxlState.GetLuaBindingList()->GetFirst(); ! while (node) { ! wxLuaBinding* binding = node->GetData(); ! if ((binding->GetLuaNamespace() == m_nameSpace) && (binding->m_luaTable_ref >= 0)) { ! m_luaTable_ref = binding->m_luaTable_ref; break; } ! node = node->GetNext(); } // first time adding this namespace table ! if (m_luaTable_ref < 1) { // create a ref for the wxLua table we're filling ! m_luaTable_ref = wxluaR_ref(L, -1, &wxlua_lreg_refs_key); } PreRegister(wxlState, bind_table_idx); // register all our classes etc. in the wxLua table --- 1028,1073 ---- // Find a registered binding with the same namespace, if any, ! // and share the table with that of the previously loaded binding ! int luaTable_ref = -1; ! ! lua_pushlightuserdata(L, &wxlua_lreg_wxluabindings_key); // push key ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (the bindings table) ! ! lua_pushnil(L); ! while (lua_next(L, -2) != 0) { ! // value = -1, key = -2, table = -3 ! wxLuaBinding* binding = (wxLuaBinding*)lua_touserdata(L, -2); ! if (binding->GetLuaNamespace() == m_nameSpace) { ! luaTable_ref = (int)lua_tonumber(L, -1); ! lua_pop(L, 2); // pop key and value break; } ! lua_pop(L, 1); // pop value, lua_next will pop key at end } + lua_pop(L, 1); // pop table + + // first time adding this namespace table ! if (luaTable_ref < 1) { // create a ref for the wxLua table we're filling ! luaTable_ref = wxluaR_ref(L, -1, &wxlua_lreg_refs_key); } + // Add us to the LUA_REGISTRYINDEX table of bindings + lua_pushlightuserdata(L, &wxlua_lreg_wxluabindings_key); // push key + lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push value (the bindings table) + + lua_pushlightuserdata(L, this); // push key + lua_pushnumber(L, luaTable_ref); // push value + lua_rawset(L, -3); // set t[key] = value; pop key and value + lua_pop(L, 1); // pop table + + // Call the binding functions PreRegister(wxlState, bind_table_idx); // register all our classes etc. in the wxLua table *************** *** 1063,1068 **** lua_pop(L, 1); // pop the table created above - m_bindings_registered = true; - return true; } --- 1077,1080 ---- *************** *** 1084,1088 **** size_t n; ! int wxl_type = m_first_wxluatype; // install the classes, functions and methods, creating new wxLua types --- 1096,1100 ---- size_t n; ! int wxl_type = WXLUA_TUNKNOWN; // install the classes, functions and methods, creating new wxLua types *************** *** 1102,1109 **** // ------------------------------------------------------------------ // Create a new metatable for this class with a numerical wxLua type index - wxl_type = wxluaT_newmetatable(L, *wxlClass->wxluatype); // create metatable, is on top of stack ! if (n == 0) ! m_first_wxluatype = wxl_type; // store a lookup in the class metatable to the wxLuaBindClass struct --- 1114,1123 ---- // ------------------------------------------------------------------ // Create a new metatable for this class with a numerical wxLua type index ! wxl_type = *wxlClass->wxluatype; ! ! // we may be reregistering this binding, get the old metatable, we'll rewrite it ! if (!wxluaT_getmetatable(L, wxl_type)) ! wxluaT_newmetatable(L, wxl_type); // create metatable, is on top of stack // store a lookup in the class metatable to the wxLuaBindClass struct *************** *** 1250,1255 **** } - m_last_wxluatype = wxl_type; - // register the global C style functions wxLuaBindMethod* wxlMethod = m_functionArray; --- 1264,1267 ---- *************** *** 1405,1412 **** // static ! wxLuaBinding* wxLuaBinding::GetLuaBinding(const wxString& bindingName, const wxLuaBindingList* bindingList_) { ! const wxLuaBindingList* bindingList = bindingList_ ? bindingList_ : &sm_bindingList; ! wxLuaBindingList::compatibility_iterator node = bindingList->GetFirst(); while (node) --- 1417,1423 ---- // static ! wxLuaBinding* wxLuaBinding::GetLuaBinding(const wxString& bindingName) { ! wxLuaBindingList::compatibility_iterator node = sm_bindingList.GetFirst(); while (node) *************** *** 1423,1430 **** // static ! const wxLuaBindClass* wxLuaBinding::GetBindClass(int wxluatype, const wxLuaBindingList* bindingList_) { ! const wxLuaBindingList* bindingList = bindingList_ ? bindingList_ : &sm_bindingList; ! wxLuaBindingList::compatibility_iterator node = bindingList->GetFirst(); while (node) --- 1434,1440 ---- // static ! const wxLuaBindClass* wxLuaBinding::FindBindClass(int wxluatype) { ! wxLuaBindingList::compatibility_iterator node = sm_bindingList.GetFirst(); while (node) *************** *** 1443,1450 **** // static ! const wxLuaBindClass* wxLuaBinding::GetBindClass(const wxLuaBindMethod* wxlMethod, const wxLuaBindingList* bindingList_) { ! const wxLuaBindingList* bindingList = bindingList_ ? bindingList_ : &sm_bindingList; ! wxLuaBindingList::compatibility_iterator node = bindingList->GetFirst(); while (node) --- 1453,1459 ---- // static ! const wxLuaBindClass* wxLuaBinding::FindBindClass(const wxLuaBindMethod* wxlMethod) { ! wxLuaBindingList::compatibility_iterator node = sm_bindingList.GetFirst(); while (node) *************** *** 1463,1470 **** // static ! const wxLuaBindClass* wxLuaBinding::GetBindClass(const wxLuaBindCFunc* wxlCFunc, const wxLuaBindingList* bindingList_) { ! const wxLuaBindingList* bindingList = bindingList_ ? bindingList_ : &sm_bindingList; ! wxLuaBindingList::compatibility_iterator node = bindingList->GetFirst(); while (node) --- 1472,1478 ---- // static ! const wxLuaBindClass* wxLuaBinding::FindBindClass(const wxLuaBindCFunc* wxlCFunc) { ! wxLuaBindingList::compatibility_iterator node = sm_bindingList.GetFirst(); while (node) *************** *** 1483,1490 **** // static ! const wxLuaBindEvent* wxLuaBinding::GetBindEvent(wxEventType eventType, const wxLuaBindingList* bindingList_) { ! const wxLuaBindingList* bindingList = bindingList_ ? bindingList_ : &sm_bindingList; ! wxLuaBindingList::compatibility_iterator node = bindingList->GetFirst(); while (node) --- 1491,1497 ---- // static ! const wxLuaBindEvent* wxLuaBinding::FindBindEvent(wxEventType eventType) { ! wxLuaBindingList::compatibility_iterator node = sm_bindingList.GetFirst(); while (node) *************** *** 1503,1510 **** // static ! wxLuaBinding* wxLuaBinding::GetFunctionBinding(const wxLuaBindMethod* wxlMethod, const wxLuaBindingList* bindingList_) { ! const wxLuaBindingList* bindingList = bindingList_ ? bindingList_ : &sm_bindingList; ! wxLuaBindingList::compatibility_iterator node = bindingList->GetFirst(); while (node) --- 1510,1516 ---- // static ! wxLuaBinding* wxLuaBinding::FindMethodBinding(const wxLuaBindMethod* wxlMethod) { ! wxLuaBindingList::compatibility_iterator node = sm_bindingList.GetFirst(); while (node) *************** *** 1577,1584 **** if (sm_bindingList_initialized && !force_update) return; ! // setup base class wxLua types wxLuaBindingList::compatibility_iterator node = sm_bindingList.GetFirst(); while (node) { wxLuaBinding* binding = node->GetData(); wxLuaBindClass* wxlClass = binding->GetClassArray(); --- 1583,1600 ---- if (sm_bindingList_initialized && !force_update) return; ! // Initialize the bindings, sort and set the wxLua types wxLuaBindingList::compatibility_iterator node = sm_bindingList.GetFirst(); while (node) { + wxLuaBinding* binding = node->GetData(); + binding->InitBinding(); + + node = node->GetNext(); + } + + // setup base class wxLua types + node = sm_bindingList.GetFirst(); + while (node) + { wxLuaBinding* binding = node->GetData(); wxLuaBindClass* wxlClass = binding->GetClassArray(); Index: wxlua_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua_bind.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wxlua_bind.cpp 23 Jan 2008 06:43:40 -0000 1.21 --- wxlua_bind.cpp 24 Jan 2008 00:18:18 -0000 1.22 *************** *** 74,77 **** --- 74,78 ---- { "WXLUA_TNIL", WXLUA_TNIL }, { "WXLUA_TNONE", WXLUA_TNONE }, + { "WXLUA_TNULL", WXLUA_TNULL }, { "WXLUA_TNUMBER", WXLUA_TNUMBER }, { "WXLUA_TSTRING", WXLUA_TSTRING }, *************** *** 79,82 **** --- 80,84 ---- { "WXLUA_TTHREAD", WXLUA_TTHREAD }, { "WXLUA_TUSERDATA", WXLUA_TUSERDATA }, + { "WXLUA_T_MAX", WXLUA_T_MAX }, { "wxLUAOBJECT_ARRAYINT", wxLUAOBJECT_ARRAYINT }, { "wxLUAOBJECT_BOOL", wxLUAOBJECT_BOOL }, *************** *** 161,170 **** static int LUACALL wxLua_function_GetBindings(lua_State *L) { - wxLuaState wxlState(L); lua_newtable(L); // the table that we return int idx = 1; wxLuaBindingList::compatibility_iterator node; ! for (node = wxlState.GetLuaBindingList()->GetFirst(); node; node = node->GetNext(), idx++) { wxLuaBinding* binding = node->GetData(); --- 163,171 ---- static int LUACALL wxLua_function_GetBindings(lua_State *L) { lua_newtable(L); // the table that we return int idx = 1; wxLuaBindingList::compatibility_iterator node; ! for (node = wxLuaBinding::GetBindingList()->GetFirst(); node; node = node->GetNext(), idx++) { wxLuaBinding* binding = node->GetData(); *************** *** 966,970 **** m_objectArray = wxLuaGetObjectList_wxlua(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxlua(m_functionCount); - InitBinding(); } --- 967,970 ---- *************** *** 984,1004 **** // --------------------------------------------------------------------------- - bool wxLuaBinding_wxlua_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("wxlua"))); - - // ignore binding request when we already have wxlua registered - if (wxlState.GetLuaBinding(wxT("wxlua"))) - return false; - - wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxlua()); - - return true; - } - bool wxLuaBinding_wxlua_init() { --- 984,987 ---- |
From: John L. <jr...@us...> - 2008-01-24 00:18:23
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5955/wxLua/modules/wxluasocket/include Modified Files: wxluasocket_bind.h 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: wxluasocket_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxluasocket_bind.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wxluasocket_bind.h 23 Jan 2008 06:43:40 -0000 1.32 --- wxluasocket_bind.h 24 Jan 2008 00:18:18 -0000 1.33 *************** *** 21,27 **** // 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 // --------------------------------------------------------------------------- --- 21,27 ---- // 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 // --------------------------------------------------------------------------- *************** *** 41,46 **** - // bind wxLuaBinding_wxluasocket to a single wxLuaState - extern WXDLLIMPEXP_WXLUASOCKET bool wxLuaBinding_wxluasocket_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxluasocket for all wxLuaStates extern WXDLLIMPEXP_WXLUASOCKET bool wxLuaBinding_wxluasocket_init(); --- 41,44 ---- |
From: John L. <jr...@us...> - 2008-01-23 06:44:09
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv692/wxLua/bindings/wxwidgets Modified Files: wxadv_override.hpp wxbase_override.hpp wxbase_rules.lua wxcore_override.hpp wxcore_rules.lua wxhtml_override.hpp wxnet_override.hpp wxstc_override.hpp wxxml_override.hpp Log Message: Use positive values for WXLUA_TXXX types not negative. Initialize the wxLua types when the bindings are initialized not when installed into Lua so we can install the bindings in any order or number for multiple wxLuaStates. Index: wxbase_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxbase_override.hpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxbase_override.hpp 15 Jan 2008 06:31:06 -0000 1.15 --- wxbase_override.hpp 23 Jan 2008 06:43:34 -0000 1.16 *************** *** 72,76 **** wxStandardPathsBase *returns = &wxStandardPaths::Get(); // push the result datatype ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxStandardPaths); return 1; --- 72,76 ---- wxStandardPathsBase *returns = &wxStandardPaths::Get(); // push the result datatype ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxStandardPaths); return 1; *************** *** 91,95 **** size_t start = 0; // get this ! wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxRegEx); // call GetMatch bool returns = self->GetMatch(&start, &len, index); --- 91,95 ---- size_t start = 0; // get this ! wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, wxluatype_wxRegEx); // call GetMatch bool returns = self->GetMatch(&start, &len, index); *************** *** 117,121 **** wxString text = wxlua_getwxStringtype(L, 2); // get this ! wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxRegEx); // call Replace int returns = self->Replace(&text, replacement, maxMatches); --- 117,121 ---- wxString text = wxlua_getwxStringtype(L, 2); // get this ! wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, wxluatype_wxRegEx); // call Replace int returns = self->Replace(&text, replacement, maxMatches); *************** *** 138,142 **** wxString text = wxlua_getwxStringtype(L, 2); // get this ! wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxRegEx); // call ReplaceAll int returns = self->ReplaceAll(&text, replacement); --- 138,142 ---- wxString text = wxlua_getwxStringtype(L, 2); // get this ! wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, wxluatype_wxRegEx); // call ReplaceAll int returns = self->ReplaceAll(&text, replacement); *************** *** 159,163 **** wxString text = wxlua_getwxStringtype(L, 2); // get this ! wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxRegEx); // call ReplaceFirst int returns = self->ReplaceFirst(&text, replacement); --- 159,163 ---- wxString text = wxlua_getwxStringtype(L, 2); // get this ! wxRegEx *self = (wxRegEx *)wxluaT_getuserdatatype(L, 1, wxluatype_wxRegEx); // call ReplaceFirst int returns = self->ReplaceFirst(&text, replacement); *************** *** 180,184 **** { // get this ! wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxConfigBase); if (wxConfigBase::Get(false) == self) // clear us from the wxConfigBase --- 180,184 ---- { // get this ! wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); if (wxConfigBase::Get(false) == self) // clear us from the wxConfigBase *************** *** 206,210 **** wxString key = wxlua_getwxStringtype(L, 2); // get this ! wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxConfigBase); // call Read bool ret = self->Read(key, &returns, defaultVal); --- 206,210 ---- wxString key = wxlua_getwxStringtype(L, 2); // get this ! wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call Read bool ret = self->Read(key, &returns, defaultVal); *************** *** 230,234 **** wxString key = wxlua_getwxStringtype(L, 2); // get this ! wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxConfigBase); // call Read bool ret = self->Read(key, &returns, defaultVal); --- 230,234 ---- wxString key = wxlua_getwxStringtype(L, 2); // get this ! wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call Read bool ret = self->Read(key, &returns, defaultVal); *************** *** 254,258 **** wxString key = wxlua_getwxStringtype(L, 2); // get this ! wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxConfigBase); // call Read bool ret = self->Read(key, &returns, defaultVal); --- 254,258 ---- wxString key = wxlua_getwxStringtype(L, 2); // get this ! wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call Read bool ret = self->Read(key, &returns, defaultVal); *************** *** 276,280 **** wxString str = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // get this ! wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxConfigBase); // call GetFirstGroup bool returns = self->GetFirstGroup(str, index); --- 276,280 ---- wxString str = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // get this ! wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call GetFirstGroup bool returns = self->GetFirstGroup(str, index); *************** *** 300,304 **** wxString str = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // get this ! wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxConfigBase); // call GetFirstEntry bool returns = self->GetFirstEntry(str, index); --- 300,304 ---- wxString str = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // get this ! wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call GetFirstEntry bool returns = self->GetFirstEntry(str, index); *************** *** 322,326 **** wxString str; // get this ! wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxConfigBase); // call GetNextGroup bool returns = self->GetNextGroup(str, index); --- 322,326 ---- wxString str; // get this ! wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call GetNextGroup bool returns = self->GetNextGroup(str, index); *************** *** 344,348 **** wxString str; // get this ! wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxConfigBase); // call GetNextEntry bool returns = self->GetNextEntry(str, index); --- 344,348 ---- wxString str; // get this ! wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call GetNextEntry bool returns = self->GetNextEntry(str, index); *************** *** 375,379 **** wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxString(returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxString); return 1; --- 375,379 ---- wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxString(returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxString); return 1; *************** *** 390,394 **** wxClassInfo *returns = wxClassInfo::FindClass((wxChar *)name.c_str()); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxClassInfo); // return the number of parameters return 1; --- 390,394 ---- wxClassInfo *returns = wxClassInfo::FindClass((wxChar *)name.c_str()); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxClassInfo); // return the number of parameters return 1; *************** *** 449,453 **** static int LUACALL wxLua_wxArrayInt_ToLuaTable(lua_State *L) { ! wxArrayInt * self = (wxArrayInt *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxArrayInt); wxlua_pushwxArrayInttable(L, *self); return 1; --- 449,453 ---- static int LUACALL wxLua_wxArrayInt_ToLuaTable(lua_State *L) { ! wxArrayInt * self = (wxArrayInt *)wxluaT_getuserdatatype(L, 1, wxluatype_wxArrayInt); wxlua_pushwxArrayInttable(L, *self); return 1; *************** *** 459,463 **** static int LUACALL wxLua_wxArrayString_ToLuaTable(lua_State *L) { ! wxArrayString * self = (wxArrayString *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxArrayString); wxlua_pushwxArrayStringtable(L, *self); return 1; --- 459,463 ---- static int LUACALL wxLua_wxArrayString_ToLuaTable(lua_State *L) { ! wxArrayString * self = (wxArrayString *)wxluaT_getuserdatatype(L, 1, wxluatype_wxArrayString); wxlua_pushwxArrayStringtable(L, *self); return 1; *************** *** 490,494 **** // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxStringList); // return the number of parameters return 1; --- 490,494 ---- // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxStringList); // return the number of parameters return 1; *************** *** 575,579 **** { // get this ! wxFileName * self = (wxFileName *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxFileName); // call GetDirs wxArrayString returns = self->GetDirs(); --- 575,579 ---- { // get this ! wxFileName * self = (wxFileName *)wxluaT_getuserdatatype(L, 1, wxluatype_wxFileName); // call GetDirs wxArrayString returns = self->GetDirs(); *************** *** 593,597 **** wxDateTime *dtAccess= new wxDateTime(); // get this ! wxFileName *self = (wxFileName *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxFileName); // call GetTimes bool returns = self->GetTimes(dtAccess, dtMod, dtCreate); --- 593,597 ---- wxDateTime *dtAccess= new wxDateTime(); // get this ! wxFileName *self = (wxFileName *)wxluaT_getuserdatatype(L, 1, wxluatype_wxFileName); // call GetTimes bool returns = self->GetTimes(dtAccess, dtMod, dtCreate); *************** *** 601,607 **** wxluaO_addgcobject(L, (void*)dtCreate, new wxLua_wxObject_wxDateTime(dtCreate)); // push the constructed class pointers ! wxluaT_pushuserdatatype(L, dtAccess, g_wxluatype_wxDateTime); ! wxluaT_pushuserdatatype(L, dtMod, g_wxluatype_wxDateTime); ! wxluaT_pushuserdatatype(L, dtCreate, g_wxluatype_wxDateTime); // push the result flag lua_pushboolean(L, returns); --- 601,607 ---- wxluaO_addgcobject(L, (void*)dtCreate, new wxLua_wxObject_wxDateTime(dtCreate)); // push the constructed class pointers ! wxluaT_pushuserdatatype(L, dtAccess, wxluatype_wxDateTime); ! wxluaT_pushuserdatatype(L, dtMod, wxluatype_wxDateTime); ! wxluaT_pushuserdatatype(L, dtCreate, wxluatype_wxDateTime); // push the result flag lua_pushboolean(L, returns); *************** *** 695,699 **** wxString filename; // get this ! wxDir *self = (wxDir *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxDir); // call GetFirst bool returns = self->GetFirst(&filename, filespec, flags); --- 695,699 ---- wxString filename; // get this ! wxDir *self = (wxDir *)wxluaT_getuserdatatype(L, 1, wxluatype_wxDir); // call GetFirst bool returns = self->GetFirst(&filename, filespec, flags); *************** *** 713,717 **** wxString filename; // get this ! wxDir *self = (wxDir *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxDir); // call GetNext bool returns = self->GetNext(&filename); --- 713,717 ---- wxString filename; // get this ! wxDir *self = (wxDir *)wxluaT_getuserdatatype(L, 1, wxluatype_wxDir); // call GetNext bool returns = self->GetNext(&filename); *************** *** 759,763 **** { // get this ! wxFile *self = (wxFile *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxFile); // call Read unsigned int returns = self->Read(buffer, count); --- 759,763 ---- { // get this ! wxFile *self = (wxFile *)wxluaT_getuserdatatype(L, 1, wxluatype_wxFile); // call Read unsigned int returns = self->Read(buffer, count); *************** *** 784,788 **** const void *buffer = (const void *)lua_tostring(L, 2); // get this ! wxFile *self = (wxFile *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxFile); // call Write unsigned int returns = self->Write(buffer, nbytes); --- 784,788 ---- const void *buffer = (const void *)lua_tostring(L, 2); // get this ! wxFile *self = (wxFile *)wxluaT_getuserdatatype(L, 1, wxluatype_wxFile); // call Write unsigned int returns = self->Write(buffer, nbytes); *************** *** 801,805 **** wxString desc; // = wxlua_getwxStringtype(L, 2); // get this ! wxFileType * self = (wxFileType *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxFileType); // call GetDescription bool returns = (self->GetDescription(&desc)); --- 801,805 ---- wxString desc; // = wxlua_getwxStringtype(L, 2); // get this ! wxFileType * self = (wxFileType *)wxluaT_getuserdatatype(L, 1, wxluatype_wxFileType); // call GetDescription bool returns = (self->GetDescription(&desc)); *************** *** 817,825 **** { // const wxFileType::MessageParameters params ! const wxFileType::MessageParameters * params = (const wxFileType::MessageParameters *)wxluaT_getuserdatatype(L, 3, g_wxluatype_wxFileType_MessageParameters); // wxString printCmd wxString printCmd; // = wxlua_getwxStringtype(L, 2); // get this ! wxFileType * self = (wxFileType *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxFileType); // call GetPrintCommand bool returns = (self->GetPrintCommand(&printCmd, *params)); --- 817,825 ---- { // const wxFileType::MessageParameters params ! const wxFileType::MessageParameters * params = (const wxFileType::MessageParameters *)wxluaT_getuserdatatype(L, 3, wxluatype_wxFileType_MessageParameters); // wxString printCmd wxString printCmd; // = wxlua_getwxStringtype(L, 2); // get this ! wxFileType * self = (wxFileType *)wxluaT_getuserdatatype(L, 1, wxluatype_wxFileType); // call GetPrintCommand bool returns = (self->GetPrintCommand(&printCmd, *params)); *************** *** 841,845 **** void *buffer = malloc(size); // get this ! wxInputStream *self = (wxInputStream *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxInputStream); if (buffer != NULL) { --- 841,845 ---- void *buffer = malloc(size); // get this ! wxInputStream *self = (wxInputStream *)wxluaT_getuserdatatype(L, 1, wxluatype_wxInputStream); if (buffer != NULL) { *************** *** 848,852 **** self->Read(buffer, size); // only return the data that was read, they already have self ! //wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxInputStream); lua_pushlstring(L, (const char *)buffer, size); free(buffer); --- 848,852 ---- self->Read(buffer, size); // only return the data that was read, they already have self ! //wxluaT_pushuserdatatype(L, returns, wxluatype_wxInputStream); lua_pushlstring(L, (const char *)buffer, size); free(buffer); *************** *** 866,870 **** const char *buffer = (const char *)lua_tostring(L, 2); // get this ! wxInputStream *self = (wxInputStream *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxInputStream); // call Ungetch size_t returns = self->Ungetch(buffer, size); --- 866,870 ---- const char *buffer = (const char *)lua_tostring(L, 2); // get this ! wxInputStream *self = (wxInputStream *)wxluaT_getuserdatatype(L, 1, wxluatype_wxInputStream); // call Ungetch size_t returns = self->Ungetch(buffer, size); *************** *** 885,893 **** const void *buffer = (void *)lua_tostring(L, 2); // get this ! wxOutputStream *self = (wxOutputStream *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxOutputStream); // call Write wxOutputStream *returns = &self->Write(buffer, size); // push the result datatype ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxOutputStream); // return the number of parameters return 1; --- 885,893 ---- const void *buffer = (void *)lua_tostring(L, 2); // get this ! wxOutputStream *self = (wxOutputStream *)wxluaT_getuserdatatype(L, 1, wxluatype_wxOutputStream); // call Write wxOutputStream *returns = &self->Write(buffer, size); // push the result datatype ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxOutputStream); // return the number of parameters return 1; *************** *** 909,913 **** wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxMemoryInputStream((wxMemoryInputStream*)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxMemoryInputStream); return 1; --- 909,913 ---- wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxMemoryInputStream((wxMemoryInputStream*)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxMemoryInputStream); return 1; Index: wxnet_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxnet_override.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxnet_override.hpp 22 Dec 2007 06:07:08 -0000 1.3 --- wxnet_override.hpp 23 Jan 2008 06:43:34 -0000 1.4 *************** *** 21,25 **** { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxSocketBase); // call Peek self->Peek(buffer, nbytes); --- 21,25 ---- { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxSocketBase); // call Peek self->Peek(buffer, nbytes); *************** *** 44,48 **** { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxSocketBase); // call Peek self->Read(buffer, nbytes); --- 44,48 ---- { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxSocketBase); // call Peek self->Read(buffer, nbytes); *************** *** 67,71 **** { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxSocketBase); // call Peek self->ReadMsg(buffer, nbytes); --- 67,71 ---- { // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxSocketBase); // call Peek self->ReadMsg(buffer, nbytes); *************** *** 90,94 **** unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxSocketBase); // call Unread self->Unread(buffer, nbytes); --- 90,94 ---- unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxSocketBase); // call Unread self->Unread(buffer, nbytes); *************** *** 109,113 **** unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxSocketBase); // call Write self->Write(buffer, nbytes); --- 109,113 ---- unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxSocketBase); // call Write self->Write(buffer, nbytes); *************** *** 128,132 **** unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxSocketBase); // call WriteMsg self->WriteMsg(buffer, nbytes); --- 128,132 ---- unsigned long nbytes = (argCount >= 3 ? (unsigned long)wxlua_getintegertype(L, 3) : lua_strlen(L, 2)); // get this ! wxSocketBase *self = (wxSocketBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxSocketBase); // call WriteMsg self->WriteMsg(buffer, nbytes); Index: wxbase_rules.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxbase_rules.lua,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxbase_rules.lua 22 Dec 2007 06:07:08 -0000 1.6 --- wxbase_rules.lua 23 Jan 2008 06:43:34 -0000 1.7 *************** *** 137,146 **** lua_State* L = wxlState.GetLuaState(); - g_wxluatag_NULL = wxluaT_newmetatable(L); - lua_pop(L, 1); // pop the table - lua_pushlstring(L, "NULL", 4); ! wxluaT_pushuserdatatype(L, NULL, g_wxluatag_NULL, true, true); lua_rawset(L, luaTable); // set t["NULL"] = userdata(NULL) w/ NULL tag ]] --- 137,148 ---- 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; + p_wxluatype_wxArrayString = &wxluatype_wxArrayString; + p_wxluatype_wxSortedArrayString = &wxluatype_wxSortedArrayString; + p_wxluatype_wxArrayInt = &wxluatype_wxArrayInt; ]] Index: wxstc_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxstc_override.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxstc_override.hpp 22 Dec 2007 06:07:08 -0000 1.5 --- wxstc_override.hpp 23 Jan 2008 06:43:34 -0000 1.6 *************** *** 16,20 **** int linePos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxStyledTextCtrl); // call GetCurLine wxString returns = self->GetCurLine(&linePos); --- 16,20 ---- int linePos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, wxluatype_wxStyledTextCtrl); // call GetCurLine wxString returns = self->GetCurLine(&linePos); *************** *** 34,38 **** int startPos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxStyledTextCtrl); // call GetSelection self->GetSelection(&startPos, &endPos); --- 34,38 ---- int startPos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, wxluatype_wxStyledTextCtrl); // call GetSelection self->GetSelection(&startPos, &endPos); *************** *** 54,58 **** int length = (int)lua_tonumber(L, 2); // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxStyledTextCtrl); // call SetStyleBytes self->SetStyleBytes(length, styleBytes); --- 54,58 ---- int length = (int)lua_tonumber(L, 2); // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxluaT_getuserdatatype(L, 1, wxluatype_wxStyledTextCtrl); // call SetStyleBytes self->SetStyleBytes(length, styleBytes); Index: wxhtml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxhtml_override.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxhtml_override.hpp 22 Dec 2007 06:07:08 -0000 1.7 --- wxhtml_override.hpp 23 Jan 2008 06:43:34 -0000 1.8 *************** *** 19,23 **** int pagebreak = (int)wxlua_getintegertype(L, 2); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxHtmlCell); // call AdjustPagebreak bool returns = self->AdjustPagebreak(&pagebreak); --- 19,23 ---- int pagebreak = (int)wxlua_getintegertype(L, 2); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, wxluatype_wxHtmlCell); // call AdjustPagebreak bool returns = self->AdjustPagebreak(&pagebreak); *************** *** 36,42 **** int pagebreak = (int)wxlua_getintegertype(L, 3); // wxArrayInt& known_pagebreaks ! wxArrayInt* known_pagebreaks = (wxArrayInt *)wxluaT_getuserdatatype(L, 2, g_wxluatype_wxArrayInt); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxHtmlCell); // call AdjustPagebreak bool returns = self->AdjustPagebreak(&pagebreak, *known_pagebreaks); --- 36,42 ---- int pagebreak = (int)wxlua_getintegertype(L, 3); // wxArrayInt& known_pagebreaks ! wxArrayInt* known_pagebreaks = (wxArrayInt *)wxluaT_getuserdatatype(L, 2, wxluatype_wxArrayInt); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, wxluatype_wxHtmlCell); // call AdjustPagebreak bool returns = self->AdjustPagebreak(&pagebreak, *known_pagebreaks); *************** *** 59,63 **** int condition = (int)wxlua_getintegertype(L, 2); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxHtmlCell); // call Find switch(lua_type(L, 3)) --- 59,63 ---- int condition = (int)wxlua_getintegertype(L, 2); // get this ! wxHtmlCell *self = (wxHtmlCell *)wxluaT_getuserdatatype(L, 1, wxluatype_wxHtmlCell); // call Find switch(lua_type(L, 3)) *************** *** 87,91 **** // push the result datatype ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxHtmlCell); // return the number of parameters return 1; --- 87,91 ---- // push the result datatype ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxHtmlCell); // return the number of parameters return 1; *************** *** 101,105 **** wxString par = wxlua_getwxStringtype(L, 2); // get this ! wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxHtmlTag); // call GetParamAsColour bool returns = self->GetParamAsColour(par, retColour); --- 101,105 ---- wxString par = wxlua_getwxStringtype(L, 2); // get this ! wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, wxluatype_wxHtmlTag); // call GetParamAsColour bool returns = self->GetParamAsColour(par, retColour); *************** *** 107,111 **** // push the result number lua_pushboolean(L, returns); ! wxluaT_pushuserdatatype(L, retColour, g_wxluatype_wxColour); // return the number of parameters return 2; --- 107,111 ---- // push the result number lua_pushboolean(L, returns); ! wxluaT_pushuserdatatype(L, retColour, wxluatype_wxColour); // return the number of parameters return 2; *************** *** 121,125 **** wxString par = wxlua_getwxStringtype(L, 2); // get this ! wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxHtmlTag); // call GetParamAsInt bool returns = self->GetParamAsInt(par, &value); --- 121,125 ---- wxString par = wxlua_getwxStringtype(L, 2); // get this ! wxHtmlTag *self = (wxHtmlTag *)wxluaT_getuserdatatype(L, 1, wxluatype_wxHtmlTag); // call GetParamAsInt bool returns = self->GetParamAsInt(par, &value); *************** *** 180,184 **** wxString normal_face = wxlua_getwxStringtype(L, 2); // get this ! wxHtmlWinParser *self = (wxHtmlWinParser *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxHtmlWinParser); // call SetFonts self->SetFonts(normal_face, fixed_face, sizes); --- 180,184 ---- wxString normal_face = wxlua_getwxStringtype(L, 2); // get this ! wxHtmlWinParser *self = (wxHtmlWinParser *)wxluaT_getuserdatatype(L, 1, wxluatype_wxHtmlWinParser); // call SetFonts self->SetFonts(normal_face, fixed_face, sizes); *************** *** 235,239 **** wxString normal_face = wxlua_getwxStringtype(L, 2); // get this ! wxHtmlWindow *self = (wxHtmlWindow *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxHtmlWindow); // call SetFonts self->SetFonts(normal_face, fixed_face, sizes); --- 235,239 ---- wxString normal_face = wxlua_getwxStringtype(L, 2); // get this ! wxHtmlWindow *self = (wxHtmlWindow *)wxluaT_getuserdatatype(L, 1, wxluatype_wxHtmlWindow); // call SetFonts self->SetFonts(normal_face, fixed_face, sizes); *************** *** 256,266 **** long style = (argCount >= 5 ? (long)wxlua_getintegertype(L, 5) : wxHW_SCROLLBAR_AUTO); // const wxSize size = wxDefaultSize ! const wxSize * size = (argCount >= 4 ? (const wxSize *)wxluaT_getuserdatatype(L, 4, g_wxluatype_wxSize) : &wxDefaultSize); // const wxPoint pos = wxDefaultPosition ! const wxPoint * pos = (argCount >= 3 ? (const wxPoint *)wxluaT_getuserdatatype(L, 3, g_wxluatype_wxPoint) : &wxDefaultPosition); // wxWindowID id = -1 wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlua_getintegertype(L, 2) : -1); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxWindow); // call constructor wxLuaHtmlWindow *returns = new wxLuaHtmlWindow(wxlState, parent, id, *pos, *size, style, name); --- 256,266 ---- long style = (argCount >= 5 ? (long)wxlua_getintegertype(L, 5) : wxHW_SCROLLBAR_AUTO); // const wxSize size = wxDefaultSize ! const wxSize * size = (argCount >= 4 ? (const wxSize *)wxluaT_getuserdatatype(L, 4, wxluatype_wxSize) : &wxDefaultSize); // const wxPoint pos = wxDefaultPosition ! const wxPoint * pos = (argCount >= 3 ? (const wxPoint *)wxluaT_getuserdatatype(L, 3, wxluatype_wxPoint) : &wxDefaultPosition); // wxWindowID id = -1 wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlua_getintegertype(L, 2) : -1); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, wxluatype_wxWindow); // call constructor wxLuaHtmlWindow *returns = new wxLuaHtmlWindow(wxlState, parent, id, *pos, *size, style, name); *************** *** 269,273 **** wxluaW_addtrackedwindow(L, (wxWindow*)returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxLuaHtmlWindow); return 1; --- 269,273 ---- wxluaW_addtrackedwindow(L, (wxWindow*)returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxLuaHtmlWindow); return 1; Index: wxcore_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxcore_override.hpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wxcore_override.hpp 22 Jan 2008 04:04:24 -0000 1.18 --- wxcore_override.hpp 23 Jan 2008 06:43:34 -0000 1.19 *************** *** 17,21 **** wxApp *returns = wxTheApp; // push the result datatype ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxApp); // return the number of parameters return 1; --- 17,21 ---- wxApp *returns = wxTheApp; // push the result datatype ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxApp); // return the number of parameters [...1871 lines suppressed...] const wxString title = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxT("Printout"))); --- 2798,2802 ---- int argCount = lua_gettop(L); // wxLuaObject pObject = NULL ! wxLuaObject * pObject = (argCount >= 2 ? (wxLuaObject *)wxluaT_getuserdatatype(L, 2, wxluatype_wxLuaObject) : NULL); // const wxString title = "Printout" const wxString title = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxT("Printout"))); *************** *** 2806,2810 **** wxluaO_addgcobject(L, (wxLuaPrintout *)returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxLuaPrintout); return 1; --- 2806,2810 ---- wxluaO_addgcobject(L, (wxLuaPrintout *)returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxLuaPrintout); return 1; Index: wxadv_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxadv_override.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxadv_override.hpp 22 Dec 2007 06:07:08 -0000 1.4 --- wxadv_override.hpp 23 Jan 2008 06:43:34 -0000 1.5 *************** *** 15,21 **** { // const wxPoint pos ! const wxPoint * pos = (const wxPoint *)wxluaT_getuserdatatype(L, 2, g_wxluatype_wxPoint); // get this ! wxCalendarCtrl * self = (wxCalendarCtrl *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxCalendarCtrl); // call HitTest wxDateTime* date = new wxDateTime(); --- 15,21 ---- { // const wxPoint pos ! const wxPoint * pos = (const wxPoint *)wxluaT_getuserdatatype(L, 2, wxluatype_wxPoint); // get this ! wxCalendarCtrl * self = (wxCalendarCtrl *)wxluaT_getuserdatatype(L, 1, wxluatype_wxCalendarCtrl); // call HitTest wxDateTime* date = new wxDateTime(); *************** *** 25,29 **** // push the result number lua_pushnumber(L, returns); ! wxluaT_pushuserdatatype(L, date, g_wxluatype_wxDateTime); lua_pushnumber(L, wd); --- 25,29 ---- // push the result number lua_pushnumber(L, returns); ! wxluaT_pushuserdatatype(L, date, wxluatype_wxDateTime); lua_pushnumber(L, wd); *************** *** 44,48 **** // get this ! wxGridCellAttr *self = (wxGridCellAttr *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxGridCellAttr); // call GetAlignment self->GetAlignment(&horz, &vert); --- 44,48 ---- // get this ! wxGridCellAttr *self = (wxGridCellAttr *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGridCellAttr); // call GetAlignment self->GetAlignment(&horz, &vert); *************** *** 63,67 **** // get this ! wxGridCellAttr *self = (wxGridCellAttr *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxGridCellAttr); // call GetAlignment self->GetSize(&num_rows, &num_cols); --- 63,67 ---- // get this ! wxGridCellAttr *self = (wxGridCellAttr *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGridCellAttr); // call GetAlignment self->GetSize(&num_rows, &num_cols); *************** *** 81,85 **** int horz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxGrid); // call GetRowLabelAlignment self->GetRowLabelAlignment(&horz, &vert); --- 81,85 ---- int horz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid); // call GetRowLabelAlignment self->GetRowLabelAlignment(&horz, &vert); *************** *** 99,103 **** int horz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxGrid); // call GetColLabelAlignment self->GetColLabelAlignment(&horz, &vert); --- 99,103 ---- int horz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid); // call GetColLabelAlignment self->GetColLabelAlignment(&horz, &vert); *************** *** 117,121 **** int horiz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxGrid); // call GetDefaultCellAlignment self->GetDefaultCellAlignment(&horiz, &vert); --- 117,121 ---- int horiz; // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid); // call GetDefaultCellAlignment self->GetDefaultCellAlignment(&horiz, &vert); *************** *** 139,143 **** int row = (int)lua_tonumber(L, 2); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxGrid); // call GetCellAlignment self->GetCellAlignment(row, col, &horiz, &vert); --- 139,143 ---- int row = (int)lua_tonumber(L, 2); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid); // call GetCellAlignment self->GetCellAlignment(row, col, &horiz, &vert); *************** *** 161,165 **** int row = (int)lua_tonumber(L, 2); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxGrid); // call GetCellAlignment self->GetCellAlignment(row, col, &num_rows, &num_cols); --- 161,165 ---- int row = (int)lua_tonumber(L, 2); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid); // call GetCellAlignment self->GetCellAlignment(row, col, &num_rows, &num_cols); *************** *** 179,187 **** long width; // wxArrayString& lines ! wxArrayString *lines = (wxArrayString *)wxluaT_getuserdatatype(L, 3, g_wxluatype_wxArrayString); // wxDC& dc ! wxDC *dc = (wxDC *)wxluaT_getuserdatatype(L, 2, g_wxluatype_wxDC); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxGrid); // call GetTextBoxSize self->GetTextBoxSize(*dc, *lines, &width, &height); --- 179,187 ---- long width; // wxArrayString& lines ! wxArrayString *lines = (wxArrayString *)wxluaT_getuserdatatype(L, 3, wxluatype_wxArrayString); // wxDC& dc ! wxDC *dc = (wxDC *)wxluaT_getuserdatatype(L, 2, wxluatype_wxDC); // get this ! wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid); // call GetTextBoxSize self->GetTextBoxSize(*dc, *lines, &width, &height); Index: wxcore_rules.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxcore_rules.lua,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxcore_rules.lua 19 Jul 2007 03:09:46 -0000 1.3 --- wxcore_rules.lua 23 Jan 2008 06:43:34 -0000 1.4 *************** *** 270,274 **** -- hook_cpp_binding_classname. You can load any other custom bindings here. -- Typically this is not necessary and you can rem this out. ! -- wxLuaBinding_PostRegister = nothing to do here --============================================================================= --- 270,278 ---- -- hook_cpp_binding_classname. You can load any other custom bindings here. -- Typically this is not necessary and you can rem this out. ! wxLuaBinding_PostRegister = ! [[ ! p_wxluatype_wxEvent = &wxluatype_wxEvent; ! p_wxluatype_wxWindow = &wxluatype_wxWindow; ! ]] --============================================================================= Index: wxxml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxxml_override.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wxxml_override.hpp 22 Dec 2007 06:07:08 -0000 1.8 --- wxxml_override.hpp 23 Jan 2008 06:43:34 -0000 1.9 *************** *** 15,21 **** { // wxXmlNode next ! wxXmlNode * next = (wxXmlNode *)wxluaT_getuserdatatype(L, 6, g_wxluatype_wxXmlNode); // wxXmlProperty props ! wxXmlProperty * props = (wxXmlProperty *)wxluaT_getuserdatatype(L, 5, g_wxluatype_wxXmlProperty); // const wxString content const wxString content = wxlua_getwxStringtype(L, 4); --- 15,21 ---- { // wxXmlNode next ! wxXmlNode * next = (wxXmlNode *)wxluaT_getuserdatatype(L, 6, wxluatype_wxXmlNode); // wxXmlProperty props ! wxXmlProperty * props = (wxXmlProperty *)wxluaT_getuserdatatype(L, 5, wxluatype_wxXmlProperty); // const wxString content const wxString content = wxlua_getwxStringtype(L, 4); *************** *** 25,29 **** wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); // wxXmlNode parent ! wxXmlNode * parent = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxXmlNode); // call constructor wxXmlNode *returns = new wxXmlNode(parent, type, name, content, props, next); --- 25,29 ---- wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); // wxXmlNode parent ! wxXmlNode * parent = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, wxluatype_wxXmlNode); // call constructor wxXmlNode *returns = new wxXmlNode(parent, type, name, content, props, next); *************** *** 32,36 **** wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxXmlNode((wxXmlNode *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, g_wxluatype_wxXmlNode); return 1; --- 32,36 ---- wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxXmlNode((wxXmlNode *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, returns, wxluatype_wxXmlNode); return 1; *************** *** 43,49 **** { // wxXmlNode child ! wxXmlNode * child = (wxXmlNode *)wxluaT_getuserdatatype(L, 2, g_wxluatype_wxXmlNode); // get this ! wxXmlNode * self = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxXmlNode); // call RemoveChild bool returns = (self->RemoveChild(child)); --- 43,49 ---- { // wxXmlNode child ! wxXmlNode * child = (wxXmlNode *)wxluaT_getuserdatatype(L, 2, wxluatype_wxXmlNode); // get this ! wxXmlNode * self = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, wxluatype_wxXmlNode); // call RemoveChild bool returns = (self->RemoveChild(child)); *************** *** 68,72 **** wxString propName = wxlua_getwxStringtype(L, 2); // get this ! wxXmlNode *self = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxXmlNode); // call GetPropVal bool returns = self->GetPropVal(propName, &value); --- 68,72 ---- wxString propName = wxlua_getwxStringtype(L, 2); // get this ! wxXmlNode *self = (wxXmlNode *)wxluaT_getuserdatatype(L, 1, wxluatype_wxXmlNode); // call GetPropVal bool returns = self->GetPropVal(propName, &value); |