From: John L. <jr...@us...> - 2007-06-14 01:23:43
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14159/wxLua/bindings Modified Files: Makefile genidocs.lua genwxbind.bat genwxbind.lua Log Message: Changed the Delete() function from the %delete tag for classes to just delete() to avoid any future name clashes since delete() is never allowed to be a function name in C++. Moved the wxStyledTextCtrl class and it's 1268 defines into the wxstc table. Moved wxLuaObject, wxLuaDebugger (and friends) into the wxlua table and added more functions for inspecting userdata and the bindings. Fix mismatches between the bindings base classes and what they really are. Index: Makefile =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 1 Jun 2007 18:19:46 -0000 1.2 --- Makefile 14 Jun 2007 01:23:07 -0000 1.3 *************** *** 16,20 **** endif ! all: wxwidgets wxstc wxluasocket wxluacan wxwidgets: --- 16,20 ---- endif ! all: wxwidgets wxstc wxlua wxluasocket wxluacan wxwidgets: *************** *** 27,30 **** --- 27,34 ---- @($(LUA) -e"rulesFilename=\"wxstc/wxstc_rules.lua\"" genwxbind.lua > wxstc/error.txt) + wxlua: + @echo Building wxLua + @($(LUA) -e"rulesFilename=\"wxlua/wxlua_rules.lua\"" genwxbind.lua > wxlua/error.txt) + wxluasocket: @echo Building wxLuaSocket Index: genwxbind.bat =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.bat,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** genwxbind.bat 4 Jan 2007 23:28:03 -0000 1.9 --- genwxbind.bat 14 Jun 2007 01:23:07 -0000 1.10 *************** *** 3,26 **** REM The C++ source files are only modified if any changes have been made. REM @echo on ! SET LUA=..\bin\wxlua-lua.exe ! REM Find a suitable wxlua-lua.exe to run ! IF EXIST ..\bin\gccud_lib\wxlua-lua.exe SET LUA=..\bin\gccud_lib\wxlua-lua.exe ! IF EXIST ..\bin\gccud_dll\wxlua-lua.exe SET LUA=..\bin\gccud_dll\wxlua-lua.exe ! IF EXIST ..\bin\gccu_lib\wxlua-lua.exe SET LUA=..\bin\gccu_lib\wxlua-lua.exe ! IF EXIST ..\bin\gccu_dll\wxlua-lua.exe SET LUA=..\bin\gccu_dll\wxlua-lua.exe ! IF EXIST ..\bin\gccd_lib\wxlua-lua.exe SET LUA=..\bin\gccd_lib\wxlua-lua.exe ! IF EXIST ..\bin\gccd_dll\wxlua-lua.exe SET LUA=..\bin\gccd_dll\wxlua-lua.exe ! IF EXIST ..\bin\gcc_lib\wxlua-lua.exe SET LUA=..\bin\gcc_lib\wxlua-lua.exe ! IF EXIST ..\bin\gcc_dll\wxlua-lua.exe SET LUA=..\bin\gcc_dll\wxlua-lua.exe ! IF EXIST ..\bin\vcud_lib\wxlua-lua.exe SET LUA=..\bin\vcud_lib\wxlua-lua.exe ! IF EXIST ..\bin\vcud_dll\wxlua-lua.exe SET LUA=..\bin\vcud_dll\wxlua-lua.exe ! IF EXIST ..\bin\vcu_lib\wxlua-lua.exe SET LUA=..\bin\vcu_lib\wxlua-lua.exe ! IF EXIST ..\bin\vcu_dll\wxlua-lua.exe SET LUA=..\bin\vcu_dll\wxlua-lua.exe ! IF EXIST ..\bin\vcd_lib\wxlua-lua.exe SET LUA=..\bin\vcd_lib\wxlua-lua.exe ! IF EXIST ..\bin\vcd_dll\wxlua-lua.exe SET LUA=..\bin\vcd_dll\wxlua-lua.exe ! IF EXIST ..\bin\vc_lib\wxlua-lua.exe SET LUA=..\bin\vc_lib\wxlua-lua.exe ! IF EXIST ..\bin\vc_dll\wxlua-lua.exe SET LUA=..\bin\vc_dll\wxlua-lua.exe echo Generating wxWidgets Binding --- 3,26 ---- REM The C++ source files are only modified if any changes have been made. REM @echo on ! SET LUA=..\bin\lua.exe ! REM Find a suitable lua.exe to run ! IF EXIST ..\bin\gccud_lib\lua.exe SET LUA=..\bin\gccud_lib\lua.exe ! IF EXIST ..\bin\gccud_dll\lua.exe SET LUA=..\bin\gccud_dll\lua.exe ! IF EXIST ..\bin\gccu_lib\lua.exe SET LUA=..\bin\gccu_lib\lua.exe ! IF EXIST ..\bin\gccu_dll\lua.exe SET LUA=..\bin\gccu_dll\lua.exe ! IF EXIST ..\bin\gccd_lib\lua.exe SET LUA=..\bin\gccd_lib\lua.exe ! IF EXIST ..\bin\gccd_dll\lua.exe SET LUA=..\bin\gccd_dll\lua.exe ! IF EXIST ..\bin\gcc_lib\lua.exe SET LUA=..\bin\gcc_lib\lua.exe ! IF EXIST ..\bin\gcc_dll\lua.exe SET LUA=..\bin\gcc_dll\lua.exe ! IF EXIST ..\bin\vcud_lib\lua.exe SET LUA=..\bin\vcud_lib\lua.exe ! IF EXIST ..\bin\vcud_dll\lua.exe SET LUA=..\bin\vcud_dll\lua.exe ! IF EXIST ..\bin\vcu_lib\lua.exe SET LUA=..\bin\vcu_lib\lua.exe ! IF EXIST ..\bin\vcu_dll\lua.exe SET LUA=..\bin\vcu_dll\lua.exe ! IF EXIST ..\bin\vcd_lib\lua.exe SET LUA=..\bin\vcd_lib\lua.exe ! IF EXIST ..\bin\vcd_dll\lua.exe SET LUA=..\bin\vcd_dll\lua.exe ! IF EXIST ..\bin\vc_lib\lua.exe SET LUA=..\bin\vc_lib\lua.exe ! IF EXIST ..\bin\vc_dll\lua.exe SET LUA=..\bin\vc_dll\lua.exe echo Generating wxWidgets Binding *************** *** 30,33 **** --- 30,36 ---- %LUA% -e"rulesFilename=\"wxstc/wxstc_rules.lua\"" genwxbind.lua > wxstc_error.txt + echo Generating wxLua Binding + %LUA% -e"rulesFilename=\"wxlua/wxlua_rules.lua\"" genwxbind.lua > wxlua_error.txt + echo Generating wxLuaDebugger Binding %LUA% -e"rulesFilename=\"wxluasocket/wxluasocket_rules.lua\"" genwxbind.lua > wxluasocket_error.txt Index: genidocs.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genidocs.lua,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** genidocs.lua 19 Dec 2006 06:18:01 -0000 1.5 --- genidocs.lua 14 Jun 2007 01:23:07 -0000 1.6 *************** *** 14,47 **** preprocConditionTable = {} ! classColour = "AA0000" ! propColour = "000077" ! memberColour = "005577" ! renameColour = "CC0033" ! overrideColour = "CC3300" ! overloadColour = "CC3333" ! operatorColour = "550077" ! enumColour = "007700" ! defineColour = "007755" ! eventColour = "557700" function GenerateTestColours(fileTable) table.insert(fileTable, "<h2>Colours used to denote types</h2>") ! table.insert(fileTable, MakeColour("Enums - %enum", enumColour).."<br>") ! table.insert(fileTable, MakeColour("Defines - %define [%string] [%object] [%pointer]", defineColour).."<br>") ! table.insert(fileTable, MakeColour("Events - %define %event", eventColour).."<br>") ! table.insert(fileTable, MakeColour("Classes - %class", classColour).."<br>") ! table.insert(fileTable, MakeColour("Class Properties - %property", propColour).."<br>") ! table.insert(fileTable, MakeColour("Class Members - %member", memberColour).."<br>") ! table.insert(fileTable, MakeColour("Renamed Functions - %rename", renameColour).."<br>") ! table.insert(fileTable, MakeColour("Overridden Functions - %override", overrideColour).."<br>") ! table.insert(fileTable, MakeColour("Overloaded Functions - %overload", overloadColour).."<br>") ! table.insert(fileTable, MakeColour("Operator Functions - %operator", operatorColour).."<br>") end ! --<a name="papers">Papers</a> ! --<a href="#papers">papers</a> function MakeColour(name, color) -- color is "RRGGBB" in hex --- 14,62 ---- preprocConditionTable = {} ! colours = {} ! colours.class = "AA0000" ! colours.prop = "000077" ! colours.member = "005577" ! colours.rename = "CC0033" ! colours.override = "CC3300" ! colours.overload = "CC3333" ! colours.operator = "550077" ! ! colours.enum = "007700" ! colours.define = "007755" ! colours.event = "557700" ! ! ! -- ---------------------------------------------------------------------------- ! -- Dummy function that genwxbind.lua has and the XXX_rules.lua might use ! -- ---------------------------------------------------------------------------- ! ! function AllocDataType() end ! ! -- ---------------------------------------------------------------------------- ! -- For testing and choosing pleasing colors ! -- ---------------------------------------------------------------------------- function GenerateTestColours(fileTable) table.insert(fileTable, "<h2>Colours used to denote types</h2>") ! table.insert(fileTable, MakeColour("Enums - %enum", colours.enum).."<br>") ! table.insert(fileTable, MakeColour("Defines - %define [%string] [%object] [%pointer]", colours.define).."<br>") ! table.insert(fileTable, MakeColour("Events - %define %event", colours.event).."<br>") ! table.insert(fileTable, MakeColour("Classes - %class", colours.class).."<br>") ! table.insert(fileTable, MakeColour("Class Properties - %property", colours.prop).."<br>") ! table.insert(fileTable, MakeColour("Class Members - %member", colours.member).."<br>") ! table.insert(fileTable, MakeColour("Renamed Functions - %rename", colours.rename).."<br>") ! table.insert(fileTable, MakeColour("Overridden Functions - %override", colours.override).."<br>") ! table.insert(fileTable, MakeColour("Overloaded Functions - %overload", colours.overload).."<br>") ! table.insert(fileTable, MakeColour("Operator Functions - %operator", colours.operator).."<br><br>") end ! ! -- ---------------------------------------------------------------------------- ! -- Make simple HTML tag items ! -- ---------------------------------------------------------------------------- function MakeColour(name, color) -- color is "RRGGBB" in hex *************** *** 55,64 **** --- 70,85 ---- end function MakeLink(name) + --<a href="#papers">papers</a> return "<a href=\"#"..name.."\">"..name.."</a>" end function MakeTag(name) + --<a name="papers">Papers</a> return "<b><a name=\""..name.."\">"..name.."</a></b>" end + -- ---------------------------------------------------------------------------- + -- Make the HTML header + -- ---------------------------------------------------------------------------- + function GenerateHeader(fileTable) table.insert(fileTable, "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">") *************** *** 71,79 **** table.insert(fileTable, "<body>") ! table.insert(fileTable, "<h1>wxLua 2.8.0.0 Class Reference for wxWidgets 2.8.0</h1>") return fileTable end function GenerateFooter(fileTable) table.insert(fileTable, "</body>") --- 92,104 ---- table.insert(fileTable, "<body>") ! table.insert(fileTable, "<h1>wxLua 2.8.4.0 Class Reference for wxWidgets 2.8.4</h1>") return fileTable end + -- ---------------------------------------------------------------------------- + -- Make the HTML footer + -- ---------------------------------------------------------------------------- + function GenerateFooter(fileTable) table.insert(fileTable, "</body>") *************** *** 83,86 **** --- 108,115 ---- end + -- ---------------------------------------------------------------------------- + -- Make the Class reference HTML code + -- ---------------------------------------------------------------------------- + function GenerateClassReference(fileTable) local names = {} *************** *** 123,126 **** --- 152,159 ---- end + -- ---------------------------------------------------------------------------- + -- Make the Enum reference HTML code + -- ---------------------------------------------------------------------------- + function GenerateEnumReference(fileTable) local names = {} *************** *** 143,146 **** --- 176,183 ---- end + -- ---------------------------------------------------------------------------- + -- Helper functions + -- ---------------------------------------------------------------------------- + local nameChars = {} -- valid chars for C variables for function names for n = string.byte("a"), string.byte("z") do nameChars[n] = true end *************** *** 170,177 **** --- 207,238 ---- end + -- ---------------------------------------------------------------------------- + -- Read the .i files and convert them to HTML + -- ---------------------------------------------------------------------------- + + function InterfaceFileNameToTag(name) + local s = name + s = string.gsub(s, "%.%./wxstc/", "wxstc_") + s = string.gsub(s, "%.%./wxlua/", "wxlua_") + s = string.gsub(s, "%.%./wxluasocket/", "wxluasocket_") + if not string.find(s, "_", 1, 1) then s = "wxwidgets_"..s end + s = string.gsub(s, "%.", "_") + + return s + end + function ReadInterfaceFiles(fileTable) table.insert(fileTable, "<h2>Interface files</h2>") + local idx = 0 + while interface_fileTable[idx+1] do + idx = idx + 1 + local s = InterfaceFileNameToTag(interface_fileTable[idx]) + + table.insert(fileTable, MakeLink(s).."<br>") + + end + local strSp = string.byte(" ") *************** *** 180,184 **** idx = idx + 1 ! table.insert(fileTable, "<HR>\n<h2>"..interface_fileTable[idx].."</h2>") local filename = interface_filepath.."/"..interface_fileTable[idx] --- 241,246 ---- idx = idx + 1 ! table.insert(fileTable, "<br><HR>\n") ! table.insert(fileTable, "<h2>"..MakeTag(InterfaceFileNameToTag(interface_fileTable[idx])).."</h2>") local filename = interface_filepath.."/"..interface_fileTable[idx] *************** *** 208,218 **** out_line = "<font size=+1>"..string.sub(out_line, 1, start_pos-1)..MakeTag(cname)..string.sub(out_line, start_pos+string.len(cname)).."</font>" ! if class_pos then out_line = MakeColour(out_line, classColour) end ! if enum_pos then out_line = "<font color=#"..enumColour..">"..out_line end else -- priortize the colouring so we don't have to check for every single case if TagIsBefore(line, "%endclass", comment_pos) then ! out_line = MakeColour(out_line, classColour) end_block = true elseif TagIsBefore(line, "%endenum", comment_pos) then --- 270,280 ---- out_line = "<font size=+1>"..string.sub(out_line, 1, start_pos-1)..MakeTag(cname)..string.sub(out_line, start_pos+string.len(cname)).."</font>" ! if class_pos then out_line = MakeColour(out_line, colours.class) end ! if enum_pos then out_line = "<font color=#"..colours.enum..">"..out_line end else -- priortize the colouring so we don't have to check for every single case if TagIsBefore(line, "%endclass", comment_pos) then ! out_line = MakeColour(out_line, colours.class) end_block = true elseif TagIsBefore(line, "%endenum", comment_pos) then *************** *** 220,236 **** end_block = true elseif TagIsBefore(line, "%property", comment_pos) then ! out_line = MakeColour(out_line, propColour) elseif TagIsBefore(line, "%member", comment_pos) then ! out_line = MakeColour(out_line, memberColour) elseif TagIsBefore(line, "%overload", comment_pos) then ! out_line = MakeColour(out_line, overloadColour) elseif TagIsBefore(line, "%rename", comment_pos) then ! out_line = MakeColour(out_line, renameColour) elseif TagIsBefore(line, "%override", 1E6) then ! out_line = MakeColour(out_line, overrideColour) elseif TagIsBefore(line, "%event", comment_pos) then ! out_line = MakeColour(out_line, eventColour) elseif TagIsBefore(line, "%define", comment_pos) then ! out_line = MakeColour(out_line, defineColour) end end --- 282,298 ---- end_block = true elseif TagIsBefore(line, "%property", comment_pos) then ! out_line = MakeColour(out_line, colours.prop) elseif TagIsBefore(line, "%member", comment_pos) then ! out_line = MakeColour(out_line, colours.member) elseif TagIsBefore(line, "%overload", comment_pos) then ! out_line = MakeColour(out_line, colours.overload) elseif TagIsBefore(line, "%rename", comment_pos) then ! out_line = MakeColour(out_line, colours.rename) elseif TagIsBefore(line, "%override", 1E6) then ! out_line = MakeColour(out_line, colours.override) elseif TagIsBefore(line, "%event", comment_pos) then ! out_line = MakeColour(out_line, colours.event) elseif TagIsBefore(line, "%define", comment_pos) then ! out_line = MakeColour(out_line, colours.define) end end *************** *** 292,295 **** --- 354,361 ---- end + -- ---------------------------------------------------------------------------- + -- Load a file of the classes listed in the wxWidgets manual + -- ---------------------------------------------------------------------------- + function LoadwxClassRef() for line in io.lines(interface_filepath.."/".."wxclassref.txt") do *************** *** 300,303 **** --- 366,373 ---- end + -- ---------------------------------------------------------------------------- + -- main() + -- ---------------------------------------------------------------------------- + function main() -- load rules file *************** *** 313,318 **** end ! -- FIXME - hack to add wxSTC table.insert(interface_fileTable, "../wxstc/stc.i") local datatypes_file = loadfile(interface_filepath.."/"..datatypes_cache_output_filename) --- 383,390 ---- end ! -- FIXME - hack to add wxSTC and other bindings table.insert(interface_fileTable, "../wxstc/stc.i") + table.insert(interface_fileTable, "../wxlua/wxlua.i") + table.insert(interface_fileTable, "../wxluasocket/wxluasocket.i") local datatypes_file = loadfile(interface_filepath.."/"..datatypes_cache_output_filename) *************** *** 330,340 **** local cache = loadfile(filename) cache() -- run loaded file - --print("loaded datatypes cache file: "..filename) else ! --print("unable to load datatypes cache file: "..filename) end end end LoadwxClassRef() --- 402,412 ---- local cache = loadfile(filename) cache() -- run loaded file else ! assert(false, "unable to load datatypes cache file: "..filename) end end end + LoadwxClassRef() Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** genwxbind.lua 13 Jun 2007 04:15:21 -0000 1.121 --- genwxbind.lua 14 Jun 2007 01:23:07 -0000 1.122 *************** *** 18,22 **** -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 12 -- 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 = 13 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. *************** *** 3716,3720 **** -- delete routine codeList = {} ! local funcName = "wxLua_"..MakeVar(parseObject.Name).."_Delete" table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") table.insert(codeList, " wxLuaState wxlState(L);\n") --- 3716,3720 ---- -- delete routine codeList = {} ! local funcName = "wxLua_"..MakeVar(parseObject.Name).."_delete" table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") table.insert(codeList, " wxLuaState wxlState(L);\n") *************** *** 3738,3742 **** local delMethodBinding = { ! LuaName = "Delete", CFunctionName = funcName, Method = codeList, --- 3738,3742 ---- local delMethodBinding = { ! LuaName = "delete", CFunctionName = funcName, Method = codeList, *************** *** 3748,3752 **** ParamCount = 1, RequiredParamCount = 1, ! Map = " { \"Delete\", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, "..funcMapName..", 1, NULL },\n", Condition = condition } --- 3748,3752 ---- ParamCount = 1, RequiredParamCount = 1, ! Map = " { \"delete\", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, "..funcMapName..", 1, NULL },\n", Condition = condition } |