From: John L. <jr...@us...> - 2006-06-12 02:48:43
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16835/wxLua/bindings Modified Files: genwxbind.lua Log Message: Fix %enum ns1::ns2::EnumName to work Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** genwxbind.lua 9 Jun 2006 22:51:30 -0000 1.73 --- genwxbind.lua 12 Jun 2006 02:48:09 -0000 1.74 *************** *** 1386,1393 **** } - if not member.AltName then - member.AltName = member.Name - end - return member end --- 1386,1389 ---- *************** *** 2892,2907 **** -- if we have wxDateTime::TZ, only take the wxDateTime part local dataType = member.DataType or "" ! local pos = string.find(dataType, "::") local namespace = "" local luaname = member.AltName or member.Name -- for %rename if pos then -- search for last ::, eg. ns1::ns2::enumName -> ns1::ns2 is namespace while pos do ! local p = string.find(dataType, "::", 1, pos) ! if p then pos = p end end namespace = string.sub(dataType, 0, pos - 1) ! luaname = MakeVar(namespace).."_"..luaname -- wxFile::read -> wxFile_read namespace = namespace.."::" end --- 2888,2907 ---- -- if we have wxDateTime::TZ, only take the wxDateTime part local dataType = member.DataType or "" ! local pos = string.find(dataType, "::", 1, 1) local namespace = "" local luaname = member.AltName or member.Name -- for %rename + if pos then -- search for last ::, eg. ns1::ns2::enumName -> ns1::ns2 is namespace while pos do ! local p = string.find(dataType, "::", pos+2, 1) ! if p then pos = p else break end end namespace = string.sub(dataType, 0, pos - 1) ! if not member.AltName then ! luaname = MakeVar(namespace).."_"..luaname -- wxFile::read -> wxFile_read ! end ! namespace = namespace.."::" end *************** *** 3350,3354 **** local funcLuaCall = nil if member.Name == parseObject.Name then ! funcName = "wxLua_"..MakeVar(member.AltName).."_constructor" funcNameBase = funcName if member.IsOverload then --- 3350,3354 ---- local funcLuaCall = nil if member.Name == parseObject.Name then ! funcName = "wxLua_"..MakeVar(member.AltName or member.Name).."_constructor" funcNameBase = funcName if member.IsOverload then *************** *** 3358,3362 **** funcType = "LuaConstructor" ! funcLuaCall = MakeVar(member.AltName) elseif member.Name == "~"..parseObject.Name then funcName = "wxLua_"..MakeVar(parseObject.Name).."_destructor" --- 3358,3362 ---- funcType = "LuaConstructor" ! funcLuaCall = MakeVar(member.AltName or member.Name) elseif member.Name == "~"..parseObject.Name then funcName = "wxLua_"..MakeVar(parseObject.Name).."_destructor" *************** *** 3364,3390 **** funcLuaCall = MakeVar(parseObject.Name) elseif member.IsConstructor then ! funcName = "wxLua_"..MakeVar(member.AltName).."_constructor" funcType = "LuaConstructor" ! funcLuaCall = MakeVar(member.AltName) elseif member.IsStaticFunction then -- static functions have two parts one as a member and one as a function ! funcName = "wxLua_"..MakeVar(parseObject.Name).."_"..MakeVar(member.AltName) funcType = "LuaMethod" ! funcLuaCall = MakeVar(member.AltName) if member.IsBuiltin then funcType = "LuaGlobal" ! funcLuaCall = MakeVar(parseObject.Name).."_"..MakeVar(member.AltName) end elseif parseObject.Name == "builtin" or member.IsBuiltin then ! funcName = "wxLua_function_"..MakeVar(member.AltName) funcType = "LuaGlobal" ! funcLuaCall = MakeVar(member.AltName) else if not parseObject.Name then print("parseObject.Name nil File: "..member.File..": (line "..member.LineNumber..") "..member.LineData.."\n") end - if not member.AltName then - print("member.AltName nil File: "..member.File..": (line "..member.LineNumber..") "..member.LineData.."\n") - end -- special case for unary -, convert from op_sub to op_neg if necessary --- 3364,3387 ---- funcLuaCall = MakeVar(parseObject.Name) elseif member.IsConstructor then ! funcName = "wxLua_"..MakeVar(member.AltName or member.Name).."_constructor" funcType = "LuaConstructor" ! funcLuaCall = MakeVar(member.AltName or member.Name) elseif member.IsStaticFunction then -- static functions have two parts one as a member and one as a function ! funcName = "wxLua_"..MakeVar(parseObject.Name).."_"..MakeVar(member.AltName or member.Name) funcType = "LuaMethod" ! funcLuaCall = MakeVar(member.AltName or member.Name) if member.IsBuiltin then funcType = "LuaGlobal" ! funcLuaCall = MakeVar(parseObject.Name).."_"..MakeVar(member.AltName or member.Name) end elseif parseObject.Name == "builtin" or member.IsBuiltin then ! funcName = "wxLua_function_"..MakeVar(member.AltName or member.Name) funcType = "LuaGlobal" ! funcLuaCall = MakeVar(member.AltName or member.Name) else if not parseObject.Name then print("parseObject.Name nil File: "..member.File..": (line "..member.LineNumber..") "..member.LineData.."\n") end -- special case for unary -, convert from op_sub to op_neg if necessary *************** *** 3396,3404 **** end ! funcName = "wxLua_"..MakeVar(parseObject.Name).."_"..MakeVar(member.AltName) if member.IsOverload then -- if not the default function then call it directly funcNameBase = "wxLua_"..MakeVar(parseObject.Name).."_"..MakeVar(member.Name) ! if (member.Name == member.AltName) then overloadCount[funcName] = (overloadCount[funcName] or 0)+1 funcName = funcName..tostring(overloadCount[funcName]) --- 3393,3401 ---- end ! funcName = "wxLua_"..MakeVar(parseObject.Name).."_"..MakeVar(member.AltName or member.Name) if member.IsOverload then -- if not the default function then call it directly funcNameBase = "wxLua_"..MakeVar(parseObject.Name).."_"..MakeVar(member.Name) ! if not member.AltName then overloadCount[funcName] = (overloadCount[funcName] or 0)+1 funcName = funcName..tostring(overloadCount[funcName]) *************** *** 3407,3411 **** funcType = "LuaMethod" ! funcLuaCall = MakeVar(member.AltName) end --- 3404,3408 ---- funcType = "LuaMethod" ! funcLuaCall = MakeVar(member.AltName or member.Name) end *************** *** 3518,3522 **** if (not member.IsOverload) or (member.Name ~= parseObject.Name) or (overloadCount[funcNameBase] == 1) then local f = funcNameBase ! if (member.Name ~= member.AltName) then f = funcName end funcMap = " { "..funcType..", \""..funcLuaCall.."\", "..f..", "..paramCount..", "..requiredParamCount..", "..overload_argList.."0 } },\n" end --- 3515,3522 ---- if (not member.IsOverload) or (member.Name ~= parseObject.Name) or (overloadCount[funcNameBase] == 1) then local f = funcNameBase ! if string.find(funcNameBase, "wxLua_wxControlWithItems_Append", 1, 1) then ! print(funcNameBase, funcName, member.Name, member.AltName) ! end ! if member.AltName and (member.AltName ~= member.Name) then f = funcName end funcMap = " { "..funcType..", \""..funcLuaCall.."\", "..f..", "..paramCount..", "..requiredParamCount..", "..overload_argList.."0 } },\n" end *************** *** 3717,3721 **** -- FIXME add the include function stuff here? if not functionBindingTable[methodcondition] then functionBindingTable[methodcondition] = {} end ! functionBindingTable[methodcondition][member.AltName] = methodBinding else if not interface.objectData[o].BindTable[methodcondition] then interface.objectData[o].BindTable[methodcondition] = {} end --- 3717,3721 ---- -- FIXME add the include function stuff here? if not functionBindingTable[methodcondition] then functionBindingTable[methodcondition] = {} end ! functionBindingTable[methodcondition][member.AltName or member.Name] = methodBinding else if not interface.objectData[o].BindTable[methodcondition] then interface.objectData[o].BindTable[methodcondition] = {} end *************** *** 3946,3951 **** indent = " " table.insert(fileData, "#if "..condition.."\n") - else - print("Condition '"..condition.."'") end --- 3946,3949 ---- |