From: John L. <jr...@us...> - 2008-01-29 00:49:44
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8389/wxLua/bindings Modified Files: genidocs_rules.lua genwxbind.lua Log Message: FIX mistake in making wxLuaState::LuaPCall() clear the stack. Cleanup to the *.i files, add output_single_cpp_binding_file to have only one cpp file generated. Add wxFileSystem and it's handlers. Index: genidocs_rules.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genidocs_rules.lua,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** genidocs_rules.lua 18 Dec 2007 01:03:32 -0000 1.6 --- genidocs_rules.lua 29 Jan 2008 00:49:10 -0000 1.7 *************** *** 1,16 **** ! ------------------------------------------------------------------------------- -- Rules to build the wxWidgets reference for wxLua -- load using : $lua -e"rulesFilename=\"rules.lua\"" genidocs.lua ! ------------------------------------------------------------------------------- ! ------------------------------------------------------------------------------- -- Set the root directory of the wxLua distribution, used only in this file wxlua_dir = "../" ! --============================================================================= -- Set the output filename for the generated html output_filename = wxlua_dir.."/docs/wxluaref.html" ! --============================================================================= -- A list of interface files to use to make the bindings. These files will be -- converted into a html file and placed in the output_filepath directory. --- 1,16 ---- ! -- ---------------------------------------------------------------------------- -- Rules to build the wxWidgets reference for wxLua -- load using : $lua -e"rulesFilename=\"rules.lua\"" genidocs.lua ! -- ---------------------------------------------------------------------------- ! -- ---------------------------------------------------------------------------- -- Set the root directory of the wxLua distribution, used only in this file wxlua_dir = "../" ! -- ============================================================================ -- Set the output filename for the generated html output_filename = wxlua_dir.."/docs/wxluaref.html" ! -- ============================================================================ -- A list of interface files to use to make the bindings. These files will be -- converted into a html file and placed in the output_filepath directory. *************** *** 160,164 **** } ! --============================================================================= -- A list of files that contain class names only that should be a complete -- list of all classes that could be wrapped. --- 160,164 ---- } ! -- ============================================================================ -- A list of files that contain class names only that should be a complete -- list of all classes that could be wrapped. *************** *** 176,184 **** ["wxAppTraits"] = "Most functions are available elsewhere", ["wxArray"] = "Not a real class, see implementations (wxArrayInt)", ! ["wxArrayInt"] = "Interchangeable with a numeric indexed lua table", ! ["wxArrayString"] = "Interchangeable with a numeric indexed lua table", ["wxBitmapHandler"] = "Base class for bitmap loaders, not needed", ["wxCondition"] = "For threading in C", ! ["wxCmdLineParser"] = "Easier to implement in lua", ["wxCSConv"] = "Lua uses ANSI 8-bit strings", --- 176,184 ---- ["wxAppTraits"] = "Most functions are available elsewhere", ["wxArray"] = "Not a real class, see implementations (wxArrayInt)", ! ["wxArrayInt"] = "Interchangeable with a numeric indexed Lua table", ! ["wxArrayString"] = "Interchangeable with a numeric indexed Lua table", ["wxBitmapHandler"] = "Base class for bitmap loaders, not needed", ["wxCondition"] = "For threading in C", ! ["wxCmdLineParser"] = "Easier to implement in Lua", ["wxCSConv"] = "Lua uses ANSI 8-bit strings", *************** *** 212,230 **** ["wxMutexLocker"] = "For threading in C", ["wxRealPoint"] = "Not used anywhere in wxWidgets", ! ["wxRecursionGuard"] = "Easier to implement in lua", ! ["wxRecursionGuardFlag"]= "Easier to implement in lua", ! ["wxScopedArray"] = "Useable in C++ only (unnecessary in lua)", ! ["wxScopedPtr"] = "Useable in C++ only (unnecessary in lua)", ! ["wxScopedTiedPtr"] = "Useable in C++ only (unnecessary in lua)", ["wxSemaphore"] = "For threading in C", ! ["wxSortedArrayString"] = "Interchangeable with a numeric indexed lua table", ! ["wxString"] = "Interchangeable with a lua string", ! ["wxStringBuffer"] = "Useable in C++ only (unnecessary in lua)", ! ["wxStringBufferLength"]= "Useable in C++ only (unnecessary in lua)", ! ["wxVariant"] = "Unnecessary in lua", ! ["wxVariantData"] = "Unnecessary in lua", } ! --============================================================================= -- The HTML header for the generated file. htmlHeader = [[ --- 212,230 ---- ["wxMutexLocker"] = "For threading in C", ["wxRealPoint"] = "Not used anywhere in wxWidgets", ! ["wxRecursionGuard"] = "Easier to implement in Lua", ! ["wxRecursionGuardFlag"]= "Easier to implement in Lua", ! ["wxScopedArray"] = "Useable in C++ only (unnecessary in Lua)", ! ["wxScopedPtr"] = "Useable in C++ only (unnecessary in Lua)", ! ["wxScopedTiedPtr"] = "Useable in C++ only (unnecessary in Lua)", ["wxSemaphore"] = "For threading in C", ! ["wxSortedArrayString"] = "Interchangeable with a numeric indexed Lua table", ! ["wxString"] = "Interchangeable with a Lua string", ! ["wxStringBuffer"] = "Useable in C++ only (unnecessary in Lua)", ! ["wxStringBufferLength"]= "Useable in C++ only (unnecessary in Lua)", ! ["wxVariant"] = "Unnecessary in Lua", ! ["wxVariantData"] = "Unnecessary in Lua", } ! -- ============================================================================ -- The HTML header for the generated file. htmlHeader = [[ *************** *** 238,242 **** <body> ! <h1>wxLua 2.8.4.0 Reference Manual for wxWidgets 2.8.7</h1> ]] --- 238,242 ---- <body> ! <h1>wxLua 2.8.7.0 Reference Manual for wxWidgets 2.8.7</h1> ]] Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** genwxbind.lua 25 Jan 2008 23:50:46 -0000 1.162 --- genwxbind.lua 29 Jan 2008 00:49:10 -0000 1.163 *************** *** 93,97 **** -- Replacement for pairs(table) that sorts them alphabetically, returns iterator -- Code from "Programming in Lua" by Roberto Ierusalimschy ! -- the input is a lua table and optional comp function (see table.sort) -- --------------------------------------------------------------------------- function pairs_sort(atable, comp_func) --- 93,97 ---- -- Replacement for pairs(table) that sorts them alphabetically, returns iterator -- Code from "Programming in Lua" by Roberto Ierusalimschy ! -- the input is a Lua table and optional comp function (see table.sort) -- --------------------------------------------------------------------------- function pairs_sort(atable, comp_func) *************** *** 195,199 **** -- determines how to handle the data type BaseClass = nil, -- the BaseClass of this, if this is a class ! IsNumber = is_number, -- can this data type be stored as a double (lua's number type) Abstract = abstract, Condition = nil, -- conditions for this data type, eg. wxLUA_USE_xxx --- 195,199 ---- -- determines how to handle the data type BaseClass = nil, -- the BaseClass of this, if this is a class ! IsNumber = is_number, -- can this data type be stored as a double (Lua's number type) Abstract = abstract, Condition = nil, -- conditions for this data type, eg. wxLUA_USE_xxx *************** *** 253,257 **** --AllocDataType("wxStructStat", "number", true) ! -- lua data types AllocDataType("lua_State", "number", false) --- 253,257 ---- --AllocDataType("wxStructStat", "number", true) ! -- Lua data types AllocDataType("lua_State", "number", false) *************** *** 279,284 **** dataTypeAttribTable["const"] = true ! dataTypeAttribTable["%gc"] = true -- this object will be gc by lua ! dataTypeAttribTable["%ungc"] = true -- this object won't be gc by lua -- attributes that can precede a function (must set equal to true) --- 279,284 ---- dataTypeAttribTable["const"] = true ! dataTypeAttribTable["%gc"] = true -- this object will be gc by Lua ! dataTypeAttribTable["%ungc"] = true -- this object won't be gc by Lua -- attributes that can precede a function (must set equal to true) *************** *** 610,614 **** -- --------------------------------------------------------------------------- ! -- Build condition string using condition stack (number indexed lua table) -- --------------------------------------------------------------------------- function BuildCondition(conditionStack) --- 610,614 ---- -- --------------------------------------------------------------------------- ! -- Build condition string using condition stack (number indexed Lua table) -- --------------------------------------------------------------------------- function BuildCondition(conditionStack) *************** *** 1460,1463 **** --- 1460,1464 ---- local time1 = os.time() + local monolithicFileData = {} local updated_files = 0 *************** *** 1471,1478 **** -- 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 --- 1472,1489 ---- -- create c/c++ file ! local fileData = {} ! if output_single_cpp_binding_file then ! fileData = monolithicFileData ! end ! ! fileData = GenerateBindingFileTable(interface, fileData) ! ! if output_single_cpp_binding_file then ! monolithicFileData[#monolithicFileData+1] = "\n\n" ! else ! local written = WriteTableToFile(interface.CPPFileName, fileData, false) ! if written then ! updated_files = updated_files + 1 ! end end end *************** *** 1485,1489 **** local fileData = {} -- reset to empty table ! fileData = GenerateHookCppFileHeader(fileData) table.insert(fileData, (hook_cpp_binding_source_includes or "").."\n") fileData = GenerateHookEventFileTable(fileData) --- 1496,1504 ---- local fileData = {} -- reset to empty table ! if output_single_cpp_binding_file then ! fileData = monolithicFileData ! end ! ! fileData = GenerateHookCppFileHeader(fileData, GetCPPFileName(hook_cpp_binding_filename)) table.insert(fileData, (hook_cpp_binding_source_includes or "").."\n") fileData = GenerateHookEventFileTable(fileData) *************** *** 3177,3181 **** end ! -- our special notation to get wxString/IntArray from a lua table of strings -- BUT! it has to be const wxArrayString& arr or wxArrayString arr -- and NOT wxArrayString& arr or wxArrayString* arr --- 3192,3196 ---- end ! -- our special notation to get wxString/IntArray from a Lua table of strings -- BUT! it has to be const wxArrayString& arr or wxArrayString arr -- and NOT wxArrayString& arr or wxArrayString* arr *************** *** 4015,4022 **** table.insert(fileData, "// ---------------------------------------------------------------------------\n") ! table.insert(fileData, "// "..hook_cpp_namespace..".h - headers and tags for wxLua binding\n") table.insert(fileData, "//\n") table.insert(fileData, "// This file was generated by genwxbind.lua \n") ! table.insert(fileData, "// Any changes made to this file may be lost when file is regenerated\n") table.insert(fileData, "// ---------------------------------------------------------------------------\n") table.insert(fileData, "\n") --- 4030,4037 ---- table.insert(fileData, "// ---------------------------------------------------------------------------\n") ! table.insert(fileData, "// "..hook_cpp_namespace..".h - headers and wxLua types for wxLua binding\n") table.insert(fileData, "//\n") table.insert(fileData, "// This file was generated by genwxbind.lua \n") ! table.insert(fileData, "// Any changes made to this file will be lost when the file is regenerated\n") table.insert(fileData, "// ---------------------------------------------------------------------------\n") table.insert(fileData, "\n") *************** *** 4178,4186 **** -- --------------------------------------------------------------------------- ! function GenerateHookCppFileHeader(fileData) table.insert(fileData, "// ---------------------------------------------------------------------------\n") ! table.insert(fileData, "// This file was generated by genwxbind.lua \n") table.insert(fileData, "//\n") ! table.insert(fileData, "// Any changes made to this file may be lost when file is regenerated.\n") table.insert(fileData, "// ---------------------------------------------------------------------------\n") table.insert(fileData, "\n") --- 4193,4201 ---- -- --------------------------------------------------------------------------- ! function GenerateHookCppFileHeader(fileData, fileName) table.insert(fileData, "// ---------------------------------------------------------------------------\n") ! table.insert(fileData, "// "..fileName.." was generated by genwxbind.lua \n") table.insert(fileData, "//\n") ! table.insert(fileData, "// Any changes made to this file will be lost when the file is regenerated.\n") table.insert(fileData, "// ---------------------------------------------------------------------------\n") table.insert(fileData, "\n") *************** *** 4600,4607 **** -- Write Hook file for an interface file -- --------------------------------------------------------------------------- ! function GenerateBindingFileTable(interface) ! local fileData = {} ! fileData = GenerateHookCppFileHeader(fileData) for k, v in pairs_sort(interface.includeFiles) do --- 4615,4621 ---- -- Write Hook file for an interface file -- --------------------------------------------------------------------------- ! function GenerateBindingFileTable(interface, fileData) ! fileData = GenerateHookCppFileHeader(fileData, interface.CPPFileName) for k, v in pairs_sort(interface.includeFiles) do *************** *** 4743,4749 **** table.insert(fileData, "-- ---------------------------------------------------------------------------\n") ! table.insert(fileData, "-- This file was generated by genwxbind.lua \n") table.insert(fileData, "-- \n") ! table.insert(fileData, "-- Any changes made to this file may be lost when file is regenerated \n") table.insert(fileData, "-- ---------------------------------------------------------------------------\n") table.insert(fileData, "\n\n") --- 4757,4763 ---- table.insert(fileData, "-- ---------------------------------------------------------------------------\n") ! table.insert(fileData, "-- "..filename.." was generated by genwxbind.lua \n") table.insert(fileData, "-- \n") ! table.insert(fileData, "-- Any changes made to this file will be lost when the file is regenerated \n") table.insert(fileData, "-- ---------------------------------------------------------------------------\n") table.insert(fileData, "\n\n") *************** *** 4859,4862 **** --- 4873,4877 ---- CheckRules() else + dofile(rulesFilename) -- get the error message print("ERROR: Unable to load rules file: '"..tostring(rulesFilename).."'") do return end |